Listing edit form: Cancel goes to Companies instead of back to the listing #628

Closed
opened 2026-10-01 10:48:30 +00:00 by tiagoagueda · 0 comments
Owner

Found on 2026-09-29 in a read-only review of postulo at 95348908d, following the links on each form.

Checked again on 2026-10-01 against main at 0a5cad587: still present.

The listing (posting) form's Cancel always goes to the Companies list, a page the person was not on. The form is reached from the listing page's Edit button and from the no-script title link in the Listings table, and saving returns to the listing itself.

  • Where: templates/jobs/posting_form.html:21 (<a href="{% url 'jobs:company_list' %}" …>{% translate "Cancel" %}</a>), used by PostingUpdateView and PostingCreateView (jobs/views.py:883-905); the entry points are templates/jobs/posting_detail.html:52 and templates/jobs/partials/listing_row.html:27.
  • What happens: someone opens Edit on a listing, changes their mind and presses Cancel. They land on Companies and have to find the listing again.
  • Fix: when editing, cancel to {{ object.get_absolute_url }}; when creating, to the company the form was opened for (the company query parameter) if there is one, otherwise to the Listings page.

Done when

  • A test in tests/test_listings_table.py renders the edit form for a listing and asserts Cancel links to that listing's page; it fails today.
Found on 2026-09-29 in a read-only review of postulo at 95348908d, following the links on each form. Checked again on 2026-10-01 against `main` at `0a5cad587`: still present. The listing (posting) form's *Cancel* always goes to the Companies list, a page the person was not on. The form is reached from the listing page's *Edit* button and from the no-script title link in the Listings table, and saving returns to the listing itself. - **Where:** `templates/jobs/posting_form.html:21` (`<a href="{% url 'jobs:company_list' %}" …>{% translate "Cancel" %}</a>`), used by `PostingUpdateView` and `PostingCreateView` (`jobs/views.py:883-905`); the entry points are `templates/jobs/posting_detail.html:52` and `templates/jobs/partials/listing_row.html:27`. - **What happens:** someone opens *Edit* on a listing, changes their mind and presses *Cancel*. They land on Companies and have to find the listing again. - **Fix:** when editing, cancel to `{{ object.get_absolute_url }}`; when creating, to the company the form was opened for (the `company` query parameter) if there is one, otherwise to the Listings page. ## Done when - A test in `tests/test_listings_table.py` renders the edit form for a listing and asserts *Cancel* links to that listing's page; it fails today.
tiagoagueda added this to the 0.6.0 milestone 2026-10-01 10:48:30 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#628
No description provided.