mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
revert column header to user, truncate notes
This commit is contained in:
parent
510da21934
commit
d1a80d3307
1 changed files with 5 additions and 4 deletions
|
@ -1240,7 +1240,7 @@ class DraftDomainAdmin(ListHeaderAdmin):
|
||||||
|
|
||||||
|
|
||||||
class VeryImportantPersonAdmin(ListHeaderAdmin):
|
class VeryImportantPersonAdmin(ListHeaderAdmin):
|
||||||
list_display = ("email", "custom_user_label", "notes", "created_at")
|
list_display = ("email", "user", "truncated_notes", "created_at")
|
||||||
search_fields = ["email"]
|
search_fields = ["email"]
|
||||||
search_help_text = "Search by email."
|
search_help_text = "Search by email."
|
||||||
list_filter = [
|
list_filter = [
|
||||||
|
@ -1250,10 +1250,11 @@ class VeryImportantPersonAdmin(ListHeaderAdmin):
|
||||||
"user",
|
"user",
|
||||||
]
|
]
|
||||||
|
|
||||||
def custom_user_label(self, obj):
|
def truncated_notes(self, obj):
|
||||||
return obj.user
|
# Truncate the 'notes' field to 200 characters
|
||||||
|
return str(obj.notes)[:50]
|
||||||
|
|
||||||
custom_user_label.short_description = "Requestor" # type: ignore
|
truncated_notes.short_description = "Notes (Truncated)" # type: ignore
|
||||||
|
|
||||||
def save_model(self, request, obj, form, change):
|
def save_model(self, request, obj, form, change):
|
||||||
# Set the user field to the current admin user
|
# Set the user field to the current admin user
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue