def _makeEmailActivation(user, email, type):
    emailActivations = EmailAddress.objects.filter(user__id=user.id, email=email)
    if emailActivations.count() > 0:
        emailActivation = emailActivations[0]
    else:
        emailActivation = EmailAddress()
        emailActivation.user = user
        emailActivation.email = email
    emailActivation.is_primary = type == "PRIMARY"
    emailActivation.is_activation_sent = False
    emailActivation.save()
    return emailActivation
예제 #2
0
def _makeEmailActivation(user, email, type):
    emailActivations = EmailAddress.objects.filter(user__id=user.id, email=email)
    if(emailActivations.count() > 0):
        emailActivation = emailActivations[0]
    else:
        emailActivation = EmailAddress()
        emailActivation.user = user
        emailActivation.email = email
    emailActivation.is_primary = type == 'PRIMARY'
    emailActivation.is_activation_sent = False
    emailActivation.save()
    return emailActivation