Skip to content

Commit

Permalink
Don't fault on invalid input in the public archive browser
Browse files Browse the repository at this point in the history
  • Loading branch information
aolkin committed Jun 19, 2024
1 parent 08452ef commit 816517b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion archive/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def get_form_kwargs(self):
def get_queryset(self):
form: forms.Form = self.get_form()
form.full_clean()
if not form.is_valid():
return []
qs = super().get_queryset().filter(space__isnull=False).distinct()
precise_qs = qs.all()
for field in form.changed_data:
Expand Down Expand Up @@ -250,4 +252,4 @@ def get_context_data(self, **kwargs):
data["photos"] = photos.all() if self.request.user.is_authenticated else photos.public()
except Show.archival_info.RelatedObjectDoesNotExist:
pass
return data
return data

0 comments on commit 816517b

Please sign in to comment.