mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-30 08:13:27 +02:00
added column for Is user to Contact table in DJA
This commit is contained in:
parent
64d0ec3f93
commit
2ffeda3be7
1 changed files with 7 additions and 0 deletions
|
@ -663,6 +663,7 @@ class ContactAdmin(ListHeaderAdmin):
|
||||||
list_display = [
|
list_display = [
|
||||||
"contact",
|
"contact",
|
||||||
"email",
|
"email",
|
||||||
|
"user_exists",
|
||||||
]
|
]
|
||||||
# this ordering effects the ordering of results
|
# this ordering effects the ordering of results
|
||||||
# in autocomplete_fields for user
|
# in autocomplete_fields for user
|
||||||
|
@ -679,6 +680,12 @@ class ContactAdmin(ListHeaderAdmin):
|
||||||
|
|
||||||
change_form_template = "django/admin/email_clipboard_change_form.html"
|
change_form_template = "django/admin/email_clipboard_change_form.html"
|
||||||
|
|
||||||
|
def user_exists(self, obj):
|
||||||
|
"""Check if the Contact has a related User"""
|
||||||
|
return obj.user is not None
|
||||||
|
user_exists.boolean = True
|
||||||
|
user_exists.short_description = "Is user"
|
||||||
|
|
||||||
# We name the custom prop 'contact' because linter
|
# We name the custom prop 'contact' because linter
|
||||||
# is not allowing a short_description attr on it
|
# is not allowing a short_description attr on it
|
||||||
# This gets around the linter limitation, for now.
|
# This gets around the linter limitation, for now.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue