Commit e1e2168d authored by Bruno Martin's avatar Bruno Martin
Browse files

add accepted terms to users signup api endpoint

parent eb4e08ef
......@@ -43,6 +43,7 @@ class RegistrationSerializer(RegisterSerializer):
# allow_null=True)
# phone_number = serializers.CharField(max_length=255, allow_null=True)
origin = serializers.CharField(max_length=30, required=False, allow_blank=True)
accepted_terms = serializers.BooleanField()
def get_cleaned_data(self):
return {
......@@ -53,7 +54,8 @@ class RegistrationSerializer(RegisterSerializer):
# 'city': self.validated_data.get('city', None),
# 'state': self.validated_data.get('state', None),
# 'phone_number': self.validated_data.get('phone_number', ''),
'origin': self.validated_data.get('origin', 'signup')
'origin': self.validated_data.get('origin', 'signup'),
'accepted_terms': self.validated_data.get('accepted_terms', ''),
}
def validate_captcha(self, attr):
......@@ -73,6 +75,7 @@ class RegistrationSerializer(RegisterSerializer):
# user.phone_number = self.cleaned_data['phone_number']
# user.city = self.cleaned_data['city']
# user.state = self.cleaned_data['state']
user.accepted_terms = self.cleaned_data['accepted_terms']
user.origin = self.cleaned_data['origin']
user.save()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment