Commit a02262dd authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

filters: Do not 500 on non-existing person

Instead 'mock' it with new instance of the class, so the results come
back empty.
Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <>
parent cf1de39f
Pipeline #22410 passed with stage
in 2 minutes and 7 seconds
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
from __future__ import absolute_import from __future__ import absolute_import
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.html import escape from django.utils.html import escape
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
...@@ -105,7 +106,10 @@ class SubmitterFilter(Filter): ...@@ -105,7 +106,10 @@ class SubmitterFilter(Filter):
return return
if submitter_id: if submitter_id:
self.person = Person.objects.get(id=int(str)) try:
self.person = Person.objects.get(id=int(str))
except ObjectDoesNotExist:
self.person = Person()
self.applied = True self.applied = True
return return
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment