[Bugfix] model FieldError

pull/530/head
ibuler 2017-03-01 15:30:19 +08:00
parent 008be6a8e3
commit 7825c107ab
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ def reverse(view_name, urlconf=None, args=None, kwargs=None,
def get_object_or_none(model, **kwargs):
try:
obj = model.objects.get(**kwargs)
except (model.FieldError, model.DoesNotExist):
except model.DoesNotExist:
return None
return obj