NASA-IMPACT / admg-backend

Apache License 2.0
2 stars 0 forks source link

Bugfix/555 table to detail view abnormalities #576

Closed alukach closed 10 months ago

alukach commented 11 months ago

What I'm changing

Bug 1

Redirecting to new different view...

Bug 2

Backup value wasn't being displayed.

How I did it

  1. Remove CanonicalDraftEdit.get() for simplicity. Not sure why needed. In general, if UUID is in URL, that's the record we should return. The unique redirect logic was causing Bug 1: https://github.com/NASA-IMPACT/admg-backend/blob/1741e810df99eca522d117ec73988dc291b09076/app/admin_ui/views/v2.py#L240-L250
  2. Simplify & cache CanonicalDraftEdit.get_object(). Lots was going on there but it wasn't entirely clear to me why.
  3. Remove check for getattr(record, "action", None) != Change.Actions.CREATE. This would never hit because we were using a queryset of only CREATE drafts: https://github.com/NASA-IMPACT/admg-backend/blob/1741e810df99eca522d117ec73988dc291b09076/app/admin_ui/views/v2.py#L101

Closes #555

alukach commented 10 months ago

Closed in favor of #579 & #578