Guest User

Untitled

a guest
Oct 31st, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. from django import forms
  2. from registration.forms import RegistrationForm
  3. from django.utils.translation import ugettext_lazy as _
  4. from ny.models import ThailandProfile
  5. from registration.models import RegistrationProfile
  6.  
  7. class RegistrationFormThailand(RegistrationForm):
  8. first_name = forms.CharField()
  9. last_name = forms.CharField()
  10.  
  11. def save(self, profile_callback=None):
  12. new_user = RegistrationProfile.objects.create_inactive_user(username=self.cleaned_data['username'],
  13. password=self.cleaned_data['password1'],
  14. email=self.cleaned_data['email'],
  15. #first_name=self.cleaned_data['first_name'],
  16. #last_name=self.cleaned_data['last_name'])
  17.  
  18. new_profile = ThailandProfile(user=new_user,
  19. first_name=self.cleaned_data['first_name'],
  20. last_name=self.cleaneD_data['last_name'])
  21. new_profile.save()
  22.  
  23. return new_user
Add Comment
Please, Sign In to add comment