Skip to content

Commit

Permalink
Fixed a bug where ntnu_username was empty and methods were being call…
Browse files Browse the repository at this point in the history
…ed on it.
  • Loading branch information
melwil committed Nov 26, 2013
1 parent 9d6e79f commit 0a23049
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 0a23049

Please sign in to comment.