NASA-IMPACT / admg-backend

Apache License 2.0
2 stars 0 forks source link

Correct record linked from Campaign table #578

Closed alukach closed 10 months ago

alukach commented 11 months ago

This PR makes the following changes:

  1. Ensures that link from the Campaign List table takes user to canonical-redirect view rather than change-update view.
  2. Updated the canonical-redirect, canonical-published-detail, and canonical-draft-edit views to no longer take in a draft UUID (ie they only require the canonical UUID + action, such as v2/<str:model>/<uuid:canonical_uuid>/<edit|view|''>).
  3. Add related_drafts(canonical_uuid: str) and related_in_progress_drafts(canonical_uuid: str) convenience methods to the Change model queryset.
  4. Strip down the logic of the CanonicalDraftEdit view to render the latest in-progress draft (ie the draft with the lowest status value). In the event of no in-progress drafts, a 404 is returned.

Related to #555