2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-04 01:35:54 +00:00

Test fixes

This commit is contained in:
Oliver Walters
2019-09-03 22:45:11 +10:00
parent 41806089e3
commit 20b37a2d11
2 changed files with 6 additions and 3 deletions

View File

@@ -84,7 +84,10 @@ class PartAttachmentCreate(AjaxCreateView):
initials = super(AjaxCreateView, self).get_initial()
# TODO - If the proper part was not sent, return an error message
initials['part'] = Part.objects.get(id=self.request.GET.get('part'))
try:
initials['part'] = Part.objects.get(id=self.request.GET.get('part', None))
except (ValueError, Part.DoesNotExist):
pass
return initials