You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hotfix: Fix invalid query when killing submissions
This fixes the below production error:
```
File ".../tin/tin/apps/submissions/views.py", line 106, in kill_view
submission = get_object_or_404(submissions_editable, id=submission_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../site-packages/django/shortcuts.py", line 85, in get_object_or_404
return queryset.get(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../site-packages/django/db/models/query.py", line 640, in get
raise self.model.MultipleObjectsReturned(
tin.apps.submissions.models.Submission.MultipleObjectsReturned: get() returned more than one Submission -- it returned 5!
```
One solution would have been to append a `.distinct()` to the query, but instead it was replaced by `filter_visible()` for consistency.
0 commit comments