Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_first_or_create method for CIVs #3602

Merged
merged 4 commits into from
Oct 9, 2024
Merged

Conversation

amickan
Copy link
Contributor

@amickan amickan commented Oct 9, 2024

There can be multiple CIVs with the same interface and value/image/file in the DB. Retrieve the first of those if that's the case rather than throwing an error.

Closes #3594

@amickan amickan requested a review from jmsmkn as a code owner October 9, 2024 09:30
@jmsmkn
Copy link
Member

jmsmkn commented Oct 9, 2024

There is also a similar error for /api/v1/algorithms/jobs/, does this solve that too?

@amickan
Copy link
Contributor Author

amickan commented Oct 9, 2024

There is also a similar error for /api/v1/algorithms/jobs/, does this solve that too?

Now it does! Hadn't seen that error on sentry yet, and foolishly only searched the codebase for instances of ComponentInterface.objects.get... Sorry!

In retrieve_existing_civs, I think we should return all existing civs, not just the first though.

@jmsmkn jmsmkn merged commit c371e83 into main Oct 9, 2024
8 checks passed
@jmsmkn jmsmkn deleted the 3594_get_existing_civs branch October 9, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot set String value for Archive Item
2 participants