Permalink
Browse files

Fix add invites bug

This fixes the bug where adding invites to a user
would set them to have unlimited invites.
  • Loading branch information...
1 parent bedff48 commit 5b48a7f632955a7eb9a3f24e7c41e51a8f48bbfa @paltman paltman committed Jan 31, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 kaleo/models.py
View
@@ -85,8 +85,9 @@ def increment_accepted(self):
@classmethod
def add_invites_to_user(cls, user, amount):
stat, _ = InvitationStat.objects.get_or_create(user=user)
- stat.invites_allocated = -1
- stat.save()
+ if stat.invites_allocated != -1:
+ stat.invites_allocated += amount
+ stat.save()
@classmethod
def add_invites(cls, amount):

0 comments on commit 5b48a7f

Please sign in to comment.