Offers: deleting an offer leaves its answer-by reminder outstanding, and it is still announced #444
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#444
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, reading the offer model and views and checking the result with a unit test against the snapshot.Related to #237.
Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atapplications/views.py:1364-1375(OfferDeleteView);applications/models.pyandapplications/services.pyhave not moved, and the same unit test gives the same result. The reminders page has since become the calendar's agenda (#316), so the calendar is where the reminder stays.Recording an offer with an answer-by date makes a reminder ("Answer … about their offer by …"). Deleting the offer does nothing to it: the reminder stays outstanding on the calendar and on the application's page, and the scheduler announces it through the person's notifiers the day before a date that belongs to an offer that no longer exists.
applications/views.py:1324-1335(OfferDeleteView, a plainDeleteView),applications/models.py:972-979(Offer.reminder,OneToOneField(..., on_delete=models.SET_NULL)),applications/services.py:645-679(_remind_to_answer, which makes the reminder).on_delete=SET_NULLprotects the offer when its reminder is deleted; it says nothing about the reminder when the offer is deleted.OfferDeleteViewhas noform_validof its own and there is nopost_deletereceiver forOffer(the only ones are indocuments/signals.pyandjobs/signals.py). Checked: an offer withanswer_bya week out, deleted throughapplications:offer_delete; the reminder was still there withdone_atNoneand due the day before at 09:00._remind_to_answeralready ticks the reminder off when the date is taken away; deleting the offer is the same case.OfferDeleteViewaform_validthat, inside one transaction, ticks off (reminder.complete()) or deletes the linked reminder when it is still outstanding, then deletes the offer; better, a smallwithdraw_offerservice besiderecord_offerandrevise_offerthat the view calls.Done when
tests/test_offers.py::test_editing_and_deleting_from_the_page(or a new test beside it) asserts that after the delete the answer-by reminder is no longer outstanding.