Example #1
0
 def save(self):
     data = self.data
     user = User(username=data['email'],
                 email=data['email'])
     user.set_password(data['password'])
     user.is_active = False
     user.save()
     token = Token(user=user)
     token.save()
     self.send_activation_email(data=data,
                                url=reverse_lazy("activate"),
                                token=token.token)
Example #2
0
 def create_token(self, value):
     token = Token(value=value)
     token.save()
     return token.token