captcha = ReCaptchaField()
accept = BooleanField()
+ origin = None
+
class Meta:
model = User
fields = ['first_name', 'last_name', 'email']
telephone=data['telephone'],
birthday=data['birthday']
)
+ if self.origin:
+ self.profile.origin = self.origin
+
if commit:
self.profile.save()
+
platform_only = data.get('platform_only') == 'True' and True or False
fascicule = data.get('fascicule') == 'True' and True or False
training = data.get('training')
class UserUseYourLawOriginForm(UserForm):
def save(self, commit=True):
- super(UserUseYourLawOriginForm, self).save(commit=commit)
- origin, c = Origin.objects.get_or_create(name="UseYourLaw")
- self.profile.origin = origin
+ self.origin, c = Origin.objects.get_or_create(name="UseYourLaw")
+ super(UserUseYourLawOriginForm, self).save(commit=True)
class CorrectorForm(ModelForm):