Project

General

Profile

0005-users-add-deletion-status-to-display_name-24430.patch

Benjamin Dauvergne, 17 Dec 2018 12:53 PM

Download (1.07 KB)

View differences:

Subject: [PATCH 5/5] users: add deletion status to display_name (#24430)

 wcs/users.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
wcs/users.py
85 85
    def ascii_name(self):
86 86
        return simplify(self.get_display_name(), space=' ')
87 87

  
88
    def get_display_name(self):
88
    def get_base_display_name(self):
89 89
        if self.name:
90 90
            return self.name
91 91
        if self.email:
92 92
            return self.email
93 93
        return _('Unknown User')
94

  
95
    def get_display_name(self):
96
        display_name = self.get_base_display_name()
97
        if self.deleted:
98
            display_name = _('%s (deleted)') % display_name
99
        return display_name
94 100
    display_name = property(get_display_name)
95 101

  
96 102
    def set_attributes_from_formdata(self, formdata):
97
-