Skip to content

Commit

Permalink
Merge pull request #615 from dotKom/anon-user-bug
Browse files Browse the repository at this point in the history
Fixed a bug where ntnu_username was empty and methods were being called on it
  • Loading branch information
christiansyoung committed Nov 26, 2013
2 parents 0ed3aea + 0a23049 commit abe036a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ def is_member(self):
"""
Returns true if the User object is associated with Online.
"""
if AllowedUsername.objects.filter(username=self.ntnu_username.lower()).filter(expiration_date__gte=timezone.now()).count() > 0:
return True
if self.ntnu_username:
if AllowedUsername.objects.filter(username=self.ntnu_username.lower()).filter(expiration_date__gte=timezone.now()).count() > 0:
return True
return False

def get_full_name(self):
Expand Down

0 comments on commit abe036a

Please sign in to comment.