Ticket #5338: user-unicode-2.diff

File user-unicode-2.diff, 541 bytes (added by Seth Buntin <seth@…>, 17 years ago)

Patch for second suggestion

  • models.py

     
    141141        search_fields = ('username', 'first_name', 'last_name', 'email')
    142142
    143143    def __unicode__(self):
    144         return self.username
     144        if self.first_name or self.last_name:
     145            return self.get_full_name()
     146        else:
     147            return self.username
    145148
    146149    def get_absolute_url(self):
    147150        return "/users/%s/" % urllib.quote(smart_str(self.username))
Back to Top