Company form: a rejected identifier still says 'Company added.' and still runs the logo fields, crashing on create #530
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#530
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, following the company form'sform_validchain and posting it in tests.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atjobs/forms.py:291-313(CompanyForm.apply_logo);jobs/views.pyhas not changed, so its lines stand.When the company form is valid but an identifier row is not, the identifiers mixin re-renders the form without saving the company. Everything around it carries on as if the save had happened: the success message is already queued, and the logo fields are acted on afterwards.
jobs/views.py:394-396and:406-408(CompanyCreateView.form_validandCompanyUpdateView.form_validadd the message beforesuper());jobs/views.py:350-353(CompanyIdentifiersMixin.form_validreturnsrender_to_responseon an invalid formset);jobs/views.py:372-379(LogoFormMixin.form_validcallsform.apply_logo(self.object)whatever the response was);jobs/forms.py:290-312(CompanyForm.apply_logo).self.objectisNone, andapply_logoreadscompany.logo_source_urlfrom it (AttributeError: 'NoneType' object has no attribute 'logo_source_url').post()or at the top of the outermostform_valid(treat an invalid formset asform_invalid), so that the success message andapply_logoare reached only on the saving path. At the least, add the message and callapply_logoonly when the response fromsuper().form_valid()is a redirect.Done when
tests/test_identifiers.pyandtests/test_logos.pythat fail today: a create with an invalid identifier answers 200 without Company added.; the same with a logo address answers 200, not 500, and fetches nothing; an edit with an invalid identifier and Remove the logo ticked leaves the logo in place.