fix(ui): prevent render failure on faulty org settings post (#8553)

Fix regression of https://codeberg.org/forgejo/forgejo/pulls/7998
Same as https://codeberg.org/forgejo/forgejo/pulls/8236 but for orgs

Amended existing tests to verify which error messages show up and not show up.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8553
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
This commit is contained in:
0ko 2025-07-18 13:13:45 +02:00 committed by Gusted
commit 6e9b97e377
2 changed files with 14 additions and 3 deletions

View file

@ -71,6 +71,9 @@ func SettingsPost(ctx *context.Context) {
ctx.Data["PageIsSettingsOptions"] = true
ctx.Data["CurrentVisibility"] = ctx.Org.Organization.Visibility
ctx.Data["CooldownPeriod"] = setting.Service.UsernameCooldownPeriod
ctx.Data["MaxAvatarFileSize"] = setting.Avatar.MaxFileSize
ctx.Data["MaxAvatarWidth"] = setting.Avatar.MaxWidth
ctx.Data["MaxAvatarHeight"] = setting.Avatar.MaxHeight
if ctx.HasError() {
ctx.HTML(http.StatusOK, tplSettingsOptions)