コード例 #1
0
ファイル: tests.py プロジェクト: tkm83za/forumAPI
 def setUp(self):
     self.sample_user = RegistrationProfile.create_inactive_user(
         username='******', password='******', email='*****@*****.**')
     self.expired_user = RegistrationProfile.create_inactive_user(
         username='******', password='******', email='*****@*****.**')
     self.expired_user.date_joined -= datetime.timedelta(
         days=settings.ACCOUNT_ACTIVATION_DAYS + 1)
     self.expired_user.save()
コード例 #2
0
 def setUp(self):
     self.sample_user = RegistrationProfile.create_inactive_user(
         username="******", password="******", email="*****@*****.**"
     )
     self.expired_user = RegistrationProfile.create_inactive_user(
         username="******", password="******", email="*****@*****.**"
     )
     self.expired_user.date_joined -= datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS + 1)
     self.expired_user.save()
コード例 #3
0
 def save(self):
     """
     Create the new ``User`` and ``RegistrationProfile``, and
     #returns the ``User``.
     
     This is essentially a light wrapper around
     ``RegistrationProfile.objects.create_inactive_user()``,
     feeding it the form data and a profile callback (see the
     documentation on ``create_inactive_user()`` for details) if
     supplied.
     
     """
     new_user = RegistrationProfile.create_inactive_user(
                                 username=self.cleaned_data['username'],
                                 password=self.cleaned_data['password1'],
                                 email=self.cleaned_data['email'],
                                 #profile_callback=profile_callback,
                                 send_email = False)
     new_user.is_active = True
     new_user.activation_key = u"ALREADY_ACTIVATED"
     new_user.save()
     #RegistrationProfile.activate_user(new_user.activation_key)
     #new_user = RegistrationProfile.create_inactive_user(
     #    username=self.cleaned_data['username'],
     #    password=self.cleaned_data['password1'],
     #    email=self.cleaned_data['email'])
     return new_user
コード例 #4
0
 def save(self):
     """
     Create the new ``User`` and ``RegistrationProfile``, and
     returns the ``User``.
     
     This is essentially a light wrapper around
     ``RegistrationProfile.objects.create_inactive_user()``,
     feeding it the form data and a profile callback (see the
     documentation on ``create_inactive_user()`` for details) if
     supplied.
     
     """
     new_user = RegistrationProfile.create_inactive_user(
         username=self.cleaned_data['username'],
         password=self.cleaned_data['password1'],
         email=self.cleaned_data['email'])
     return new_user
コード例 #5
0
ファイル: forms.py プロジェクト: niragInes/Blongo
    def save(self):
        """
        Create the new ``User`` and ``RegistrationProfile``, and
        returns the ``User``.

        This is essentially a light wrapper around
        ``RegistrationProfile.objects.create_inactive_user()``,
        feeding it the form data and a profile callback (see the
        documentation on ``create_inactive_user()`` for details) if
        supplied.

        """
        new_user = RegistrationProfile.create_inactive_user(
            username=self.cleaned_data['username'],
            password=self.cleaned_data['password1'],
            email=self.cleaned_data['email'])
        return new_user