Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

tweak warnings in Person admin

  • Loading branch information...
commit 44cc1c8337757a80c0aca38216032f8d6b9733cb 1 parent beb6576
@evildmp authored
Showing with 4 additions and 9 deletions.
  1. +4 −9 contacts_and_people/admin.py
View
13 contacts_and_people/admin.py
@@ -189,23 +189,18 @@ class PersonAdmin(PersonAndEntityAdmin):
# list_editable = ('user',)
filter_horizontal = ('entities',)
prepopulated_fields = {'slug': ('title', 'given_name', 'middle_names', 'surname',)}
- readonly_fields = ['get_full_address', 'role']
+ readonly_fields = ['get_full_address',]
def get_full_address(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."
else:
- return "%s" % (", ".join(instance.get_full_address)) or "Warning: this person has no address."
+ return "%s" % (", ".join(instance.get_full_address)) or "<span class='errors'>Warning: this person has no address.</span>"
get_full_address.short_description = "Address"
-
- def role(self, instance):
- return models.Membership.objects.get(
- person = instance,
- entity__abstract_entity = False,
- importance_to_person = 5)
+ get_full_address.allow_tags = True
- name_fieldset = ('Name', {'fields': ('title', 'given_name', 'middle_names', 'surname', 'role'),})
+ name_fieldset = ('Name', {'fields': ('title', 'given_name', 'middle_names', 'surname',),})
override_fieldset = ('Over-ride default output', {
'fields': ('please_contact', 'building',),
'classes': ('collapse',)

0 comments on commit 44cc1c8

Please sign in to comment.
Something went wrong with that request. Please try again.