Esempio n. 1
0
def create_twitter_profile(id, oauth_token, oauth_token_secret, name):
    profile = UserProfile()
    profile.user_id = id
    profile.oauth_token = oauth_token
    profile.oauth_secret = oauth_token_secret
    profile.screen_name = name
    profile.save()
Esempio n. 2
0
 def create_user(self, application, commit=True):
     """
     Create related User and UserProfile instance for the given
     BetaTestApplication.
     """
     user = User(
         username=self.cleaned_data['username'],
         email=self.cleaned_data['email'],
     )
     user.set_password(self.cleaned_data['password'])
     profile = UserProfile(full_name=self.cleaned_data['full_name'], )
     if commit:
         with transaction.atomic():
             user.save()
             profile.user_id = user.pk
             application.user_id = user.pk
             profile.save()
             application.save()
Esempio n. 3
0
 def create_user(self, application, commit=True):
     """
     Create related User and UserProfile instance for the given
     BetaTestApplication.
     """
     user = User(
         username=self.cleaned_data['username'],
         email=self.cleaned_data['email'],
     )
     user.set_password(self.cleaned_data['password'])
     profile = UserProfile(
         full_name=self.cleaned_data['full_name'],
     )
     if commit:
         with transaction.atomic():
             user.save()
             profile.user_id = user.pk
             application.user_id = user.pk
             profile.save()
             application.save()
Esempio n. 4
0
 def create_user(self, application, commit=True):
     """
     Create related User and UserProfile instance for the given
     BetaTestApplication.
     """
     user = User(
         username=self.cleaned_data['username'],
         email=self.cleaned_data['email'],
     )
     user.set_password(self.cleaned_data['password'])
     profile = UserProfile(
         full_name=self.cleaned_data['full_name'],
         accepted_privacy_policy=timezone.now(),
         subscribe_to_updates=self.cleaned_data['subscribe_to_updates'],
     )
     if commit:
         with transaction.atomic():
             user.save()
             profile.user_id = user.pk
             application.user_id = user.pk
             profile.save()
             application.save()