forgejo_backup/routers/web/user/setting
oliverpool 285f66b782 fix: prevent 500 message on invalid username (#8236)
Bug introduced by #7998

### Tests

- go to your settings page https://v12.next.forgejo.org/user/settings
- try to change to an invalid username (like `.well--invalid`)
- verify that no 500 error is shown, only a flash message

I tried to add a test in `tests/integration/user_test.go`, but failed to catch the error message:

```
		resp := session.MakeRequest(t, req, http.StatusOK)
		txt := resp.Body.String()
		t.Log(txt) // no template error??
		t.FailNow()
```

### Release notes

- [x] I do not want this change to show in the release notes.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8236
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-06-19 18:31:08 +02:00
..
security feat: consider WebAuthn & SSH for instance signing (#7693) 2025-04-29 10:34:07 +00:00
account.go feat: add validating user password as trace region (#7981) 2025-05-28 14:46:23 +02:00
account_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
adopt.go chore(i18n): cleanup settings.adopt string (#7451) 2025-04-03 16:50:39 +00:00
applications.go Add new CLI flags to set name and scopes when creating a user with access token (#34080) 2025-04-07 17:26:34 +02:00
blocked_users.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
keys.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
oauth2.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
oauth2_common.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
packages.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
profile.go fix: prevent 500 message on invalid username (#8236) 2025-06-19 18:31:08 +02:00
runner.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
storage_overview.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
webhooks.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00