Пример #1
0
def process_used_signup_code(sender, **kwargs):
    result = kwargs.get("signup_code_result")
    try:
        invite = result.signup_code.joininvitation
        invite.to_user = result.user
        invite.status = JoinInvitation.STATUS_ACCEPTED
        invite.save()
        stat = invite.from_user.invitationstat
        stat.invites_accepted += 1
        stat.save()
        invite_accepted.send(sender=JoinInvitation, invitation=invite)
    except JoinInvitation.DoesNotExist:
        pass
Пример #2
0
 def accept(self, user):
     self.to_user = user
     self.status = JoinInvitation.STATUS_ACCEPTED
     self.save()
     self.from_user.invitationstat.increment_accepted()
     invite_accepted.send(sender=JoinInvitation, invitation=self)
Пример #3
0
 def accept(self, user):
     self.to_user = user
     self.status = JoinInvitation.STATUS_ACCEPTED
     self.save()
     self.from_user.invitationstat.increment_accepted()
     invite_accepted.send(sender=JoinInvitation, invitation=self)