NASA-IMPACT / admg-backend

Apache License 2.0
2 stars 0 forks source link

fix: Ensure Campaign visible in CDPI choices field #533

Closed alukach closed 1 year ago

alukach commented 1 year ago

Note This PR is based off of #532, I recommend reviewing that first.

What I'm changing

While working on #532, I noticed that the CDPI options were missing campaign names.

Before

https://github.com/NASA-IMPACT/admg-backend/assets/897290/162bab24-45d2-483f-821e-66385cb0587c

After

https://github.com/NASA-IMPACT/admg-backend/assets/897290/e7ddccd3-9b50-4df2-9aa9-8236b496ffc4

How I did it

Fix the logic around grabbing the short_name of the Campaign related to the Deployment mentioned in the CollectionPeriod draft. This required some clever annotation jumping that was more challenging than expected.

How you can test it

I recommend you update your local dev DB to match the staging db (see "How I did it" in #532). Any DOI approval form should demonstrate this issue.