Skip to content

Commit

Permalink
fix: TranslatableModelAdminMixin when obj is NoneType
Browse files Browse the repository at this point in the history
  • Loading branch information
thoas committed Jul 1, 2019
1 parent ad40259 commit 6b5b924
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion linguist/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class TranslatableModelAdminMixin(object):

def get_object(self, *args, **kwargs):
obj = super(TranslatableModelAdminMixin, self).get_object(*args, **kwargs)
obj.prefetch_translations()
if obj:
obj.prefetch_translations()

return obj

def get_changelist(self, request, **kwargs):
Expand Down

0 comments on commit 6b5b924

Please sign in to comment.