Skip to content

Commit 16bb122

Browse files
committed
Added the 'plain' field to the Person admin.
- Legacy-Id: 18178
1 parent 4bc6a20 commit 16bb122

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ietf/person/admin.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ class AliasInline(admin.StackedInline):
2424

2525
class PersonAdmin(simple_history.admin.SimpleHistoryAdmin):
2626
def plain_name(self, obj):
27-
prefix, first, middle, last, suffix = name_parts(obj.name)
28-
return "%s %s" % (first, last)
27+
if obj.plain:
28+
return obj.plain
29+
else:
30+
prefix, first, middle, last, suffix = name_parts(obj.name)
31+
return "%s %s" % (first, last)
2932
list_display = ["name", "short", "plain_name", "time", "user", ]
30-
fields = ("user", "time", "name", "name_from_draft", "ascii", "ascii_short", "biography", "photo", "photo_thumb", "consent",)
33+
fields = ("user", "time", "name", "plain", "name_from_draft", "ascii", "ascii_short", "biography", "photo", "photo_thumb", "consent",)
3134
readonly_fields = ("name_from_draft", )
3235
search_fields = ["name", "ascii"]
3336
raw_id_fields = ["user"]

0 commit comments

Comments
 (0)