def activate_user(strategy, user, *args, **kwargs): '''Activate the user and send a confirmation email''' if not user: return user.is_active = True user.save() send_confirmation(strategy, user)
def send_confirmation_mail(sender, email, **kwargs): if sender.email == email and not sender.is_active: sender.is_active = True sender.save() mail.send_confirmation(sender)