Пример #1
0
def on_new_user_send_validation_email(sender,
                                      instance=None,
                                      created=False,
                                      **kwargs):
    if created:
        user = instance
        send_validation_email(user)
Пример #2
0
    def save(self, **kwargs):
        # If email has changed, invalidate confirmation state
        if self.pk is not None:
            orig = DuskenUser.objects.get(pk=self.pk)
            if orig.email != self.email:
                self.email_confirmed_at = None
                self.email_key = create_email_key()
                send_validation_email(self)

        super().save(**kwargs)
Пример #3
0
    def invalidate_confirmation_state(self):
        if self.pk is not None:
            orig = DuskenUser.objects.get(pk=self.pk)

            if orig.email != self.email:
                self.email_confirmed_at = None
                self.email_key = create_email_key()
                send_validation_email(self)

            if orig.phone_number != self.phone_number:
                self.phone_number_confirmed = False
                self.phone_number_confirmed_at = None
Пример #4
0
 def post(self, request, format=None):
     send_validation_email(request.user)
     return Response({'response': 'success'})
Пример #5
0
def on_new_user_send_validation_email(sender, instance=None, created=False, **kwargs):
    if created:
        user = instance
        send_validation_email(user)