X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/2d26c0dc1c3847d9b8f8281705d277341ea95ab8..62ed3da3a2ef892a787a24ece991b0bf9b39e112:/forum/models/user.py diff --git a/forum/models/user.py b/forum/models/user.py index 7f15d21..cf47c66 100644 --- a/forum/models/user.py +++ b/forum/models/user.py @@ -117,7 +117,7 @@ class UserManager(CachedManager): if len(matching_users) == 1: return matching_users[0] - else: + elif len(matching_users) > 1: for user in matching_users: if user.username == kwargs['username']: return user @@ -165,8 +165,8 @@ class User(BaseModel, DjangoUser): #todo: temporary thing, for now lets just assume that the site owner will always be the first user of the application return self.id == 1 - @property - def decorated_name(self): + + def _decorated_name(self): username = smart_unicode(self.username) if len(username) > TRUNCATE_USERNAMES_LONGER_THAN and TRUNCATE_LONG_USERNAMES: @@ -181,6 +181,10 @@ class User(BaseModel, DjangoUser): return username + @property + def decorated_name(self): + return self._decorated_name() + @property def last_activity(self): try: