Server settings → Defaults: a language error blanks the form above it, and saving that form then wipes the defaults #494
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#494
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, readingDefaultsView.postand posting an invalid language list in a test.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atcore/server_views.py:581-597(DefaultsView.post), one line lower and otherwise unchanged.Defaults holds two forms saved separately: the instance's name and defaults, and the offered languages. When the languages form is refused, the view re-renders the page with the main form bound to the languages POST and to no instance, so the name, tagline, default language and time zone above come back empty, and the name is marked as a required field in error.
core/server_views.py:580-596,DefaultsView.post: on the invalid path it setsself.object = Noneand callsself.get_context_data(languages_form=form).FormMixin.get_context_datathen builds the main form fromget_form_kwargs(), which binds it torequest.POST(carrying none ofinstance_name,tagline,default_languageordefault_time_zone) withinstance=None.<input … name="instance_name" … required aria-invalid="true" …>with no value, and the time zone select on its empty option (<option value="" selected>). If the administrator then types the name again and presses Save on the upper card, the default language and time zone they did not touch are stored blank.self.object = self.get_object()andself.get_context_data(form=self.get_form_class()(instance=self.object), languages_form=form).Done when
tests/test_server_settings.pyhas a test that stores an instance name and a default time zone, posts an invalid language list to Defaults, and finds the stored name in theinstance_nameinput, the stored time zone selected, and no error on the name. It fails today.