]> git.openstreetmap.org Git - osqa.git/commitdiff
Small fix on the new get method for users.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 22 Dec 2011 19:04:11 +0000 (19:04 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 22 Dec 2011 19:04:11 +0000 (19:04 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1218 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/user.py

index 7f15d21dc38db441befcb9c6a5c554eaddd06cd5..695501f53113a531b41c67ecc97ff979bbe071a3 100644 (file)
@@ -117,7 +117,7 @@ class UserManager(CachedManager):
             
             if len(matching_users) == 1:
                 return matching_users[0]
             
             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
                 for user in matching_users:
                     if user.username == kwargs['username']:
                         return user