[MERGE] Don't crash if user's full name is unset

Stephen Gallagher sgallagh at redhat.com
Tue Apr 20 17:10:15 UTC 2010


On 04/20/2010 12:33 PM, Toshio Kuratomi wrote:
> On Tue, Apr 20, 2010 at 10:22:17AM -0400, Stephen Gallagher wrote:
>> === modified file 'fedora/django/auth/models.py'
>> --- fedora/django/auth/models.py	2010-04-19 20:56:48 +0000
>> +++ fedora/django/auth/models.py	2010-04-20 14:19:07 +0000
>> @@ -122,4 +122,6 @@
>>       objects = FasUserManager()
>>
>>       def get_full_name(self):
>> -        return self.name.strip()
>> +        if self.name:
>> +            return self.name.strip()
>> +        return self.username.strip()
>>
> Would we rather return username or empty string (u"") in case of error?
>
> -Toshio


I think username makes more sense, as this value is often used for 
personalization of a page. For example, in ReviewBoard, after login it 
will display "Welcome, User Name" in the upper-right corner.

I think using the username will read better.

-- 
Stephen Gallagher
RHCE 804006346421761

Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/


More information about the infrastructure mailing list