コード例 #1
0
ファイル: models.py プロジェクト: amitagrawal/kaleo
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
ファイル: models.py プロジェクト: abal09/kaleo
 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)