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 <arkadiusz.hiler@intel.com>
parent cf1de39f
Pipeline #22410 passed with stage
in 2 minutes and 7 seconds
......@@ -19,6 +19,7 @@
from __future__ import absolute_import
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import User
from django.utils.html import escape
from django.utils.safestring import mark_safe
......@@ -105,7 +106,10 @@ class SubmitterFilter(Filter):
return
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
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