Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Commit

Permalink
Merge pull request #74 from ckirby/ckirby-patch-1
Browse files Browse the repository at this point in the history
Fix AttributeError Issue #73
  • Loading branch information
lambdalisue committed Sep 29, 2016
2 parents 9978e6f + fb25fd2 commit 19fa9d7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/registration/admin/__init__.py
Expand Up @@ -140,7 +140,13 @@ def get_readonly_fields(self, request, obj=None):
fields = self.model.get_admin_fields()
excludes = self.model.get_admin_excludes()
if fields is None:
fields = self.model._meta.get_all_field_names()
try:
#<django 1.10 _meta API
fields = self.model._meta.get_all_field_names()
except AttributeError:
#django 1.10+ _meta API
fields = [f.name for f in self.model._meta.get_fields()]

if 'id' in fields:
fields.remove('id')
if 'registration_profile_id' in fields:
Expand Down

0 comments on commit 19fa9d7

Please sign in to comment.