Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django import forms
- from registration.forms import RegistrationForm
- from django.utils.translation import ugettext_lazy as _
- from ny.models import ThailandProfile
- from registration.models import RegistrationProfile
- class RegistrationFormThailand(RegistrationForm):
- first_name = forms.CharField()
- last_name = forms.CharField()
- def save(self, profile_callback=None):
- new_user = RegistrationProfile.objects.create_inactive_user(username=self.cleaned_data['username'],
- password=self.cleaned_data['password1'],
- email=self.cleaned_data['email'],
- #first_name=self.cleaned_data['first_name'],
- #last_name=self.cleaned_data['last_name'])
- new_profile = ThailandProfile(user=new_user,
- first_name=self.cleaned_data['first_name'],
- last_name=self.cleaneD_data['last_name'])
- new_profile.save()
- return new_user
Add Comment
Please, Sign In to add comment