Skip to content

Fix #82: replace releaseapi_set.get() with .all() to avoid MultipleOb…#134

Open
subinita01 wants to merge 1 commit intocytoscape:masterfrom
subinita01:fix/issue-82-multiple-objects-returned
Open

Fix #82: replace releaseapi_set.get() with .all() to avoid MultipleOb…#134
subinita01 wants to merge 1 commit intocytoscape:masterfrom
subinita01:fix/issue-82-multiple-objects-returned

Conversation

@subinita01
Copy link
Copy Markdown

…jectsReturned

.get() raises MultipleObjectsReturned if more than one ReleaseAPI exists for a Release. Iterating over .all() handles any number of related objects.

…ultipleObjectsReturned

.get() raises MultipleObjectsReturned if more than one ReleaseAPI exists
for a Release. Iterating over .all() handles any number of related objects.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@subinita01
Copy link
Copy Markdown
Author

Problem

Release.delete_files() calls self.releaseapi_set.get() after only
checking that at least one ReleaseAPI exists. If more than one exists,
Django raises MultipleObjectsReturned.

Fix

Replace the count() > 0 guard and .get() call with iteration over
.all(), which safely handles zero, one, or many related objects.

Fixes #82

@subinita01 subinita01 closed this Mar 24, 2026
@subinita01 subinita01 reopened this Mar 24, 2026
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.

1 participant