Permalink
Browse files

AlreadyRegistered for PersonAdmin

  • Loading branch information...
1 parent c521364 commit 412a26e3d797aad61f88effcfd43b2ebea220052 @evildmp committed Oct 22, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 contacts_and_people/admin.py
@@ -192,6 +192,11 @@ class PersonAdmin(PersonAndEntityAdmin):
prepopulated_fields = {'slug': ('title', 'given_name', 'middle_names', 'surname',)}
readonly_fields = ['address_report',]
+ # def __init__(self, model, admin_site):
+ # print self.readonly_fields
+ # super(PersonAdmin, self).__init__(model, admin_site)
+ # return
+
def address_report(self, instance):
if instance.building and instance.get_full_address == instance.get_entity.get_full_address:
return "Warning: this Person has the Specify Building field set, probably unnecessarily."
@@ -501,8 +506,8 @@ class BuildingAdmin(ModelAdminWithTabsAndCMSPlaceholder):
)
try:
- admin.site.register(models.Person,PersonAdmin)
-except AlreadyRegistered:
+ admin.site.register(models.Person, PersonAdmin)
+except admin.sites.AlreadyRegistered:
pass
admin.site.register(models.Building,BuildingAdmin)

0 comments on commit 412a26e

Please sign in to comment.