Esempio n. 1
0
 def save_model(self, request, obj, form, change):
     if not change:
         obj.username = obj.email
         obj.password = User.objects.make_random_password(
             getattr(settings, 'ACCOUNT_RANDOM_PASSWD_LENGTH', 10))
         user_signed_up.send(sender=self, user=obj)
     obj.save()
Esempio n. 2
0
 def after_signup(self, user, **kwargs):
     """
     An extension point for subclasses.
     """
     user_signed_up.send(sender=SignupForm, user=user)
Esempio n. 3
0
 def test_creates_key_when_user_signs_up(self):
     self.assertFalse(APIKey.objects.filter(user=self.user).exists())
     user_signed_up.send(self.__class__, user=self.user, form={})
     self.assertTrue(APIKey.objects.filter(user=self.user).exists())
     APIKey.objects.get(user=self.user).delete()
Esempio n. 4
0
 def after_signup(self, form):
     if self.signup_code:
         self.signup_code.use(self.created_user)
     user_signed_up.send(sender=SignupForm, user=self.created_user)
Esempio n. 5
0
 def save_model(self, request, obj, form, change):
     if not change:
         obj.username = obj.email
         obj.password = User.objects.make_random_password(getattr(settings, 'ACCOUNT_RANDOM_PASSWD_LENGTH', 10))
         user_signed_up.send(sender=self, user=obj)
     obj.save()
Esempio n. 6
0
 def after_signup(self, form):
     """ mainly create profile entity """
     user_signed_up.send(sender=SignupForm, user=self.created_user, form=form)
Esempio n. 7
0
 def after_signup(self, user, **kwargs):
     """
     An extension point for subclasses.
     """
     user_signed_up.send(sender=SignupForm, user=user)