NASA-IMPACT / admg-backend

Apache License 2.0
2 stars 0 forks source link

Bugfixes for Adding Related Objects to Deployment #595

Closed edkeeble closed 9 months ago

edkeeble commented 9 months ago

A few bugfixes here:

  1. When clicking the + button on related items (IOP, Significant Event, CDPI), we weren't providing the correct deployment UUID, which threw an error
  2. After saving a related item, we now redirect to the canonical edit view in order to preserve the new back link behavior
  3. The back links weren't working if we didn't have any published objects. Updated to correctly look up the related campaign, given either a Change object representing a deployment or a Change object representing a deployment-child object
  4. Related items were not appearing on campaign detail page if they were related to an unpublished deployment. Fixed that.

I also noticed that the Validate button is not working when editing related items. The problem is we disable the form field for foreign keys, so they aren't included in the form submission. When the model_form gets validated, it fails due to a missing deployment (or other related item). Need to think of a fix for that, but these changes will at least allow people to create related items again.