Commit 83a99413 authored by Laury Bueno's avatar Laury Bueno
Browse files

[Users] Removed unused fields

parent 2e9a466f
...@@ -16,20 +16,18 @@ class UserSerializer(serializers.HyperlinkedModelSerializer): ...@@ -16,20 +16,18 @@ class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta: class Meta:
model = User model = User
fields = ('id', 'image', 'name', 'email', 'biography', 'city', fields = ('id', 'image', 'name', 'email', 'biography', 'city',
'state', 'country', 'username', 'race', 'gender', 'tour_step', 'state', 'country', 'username', 'race', 'gender',
'occupation', 'age', 'political_movement', 'is_superuser', ) 'occupation', 'is_superuser', )
class RegistrationSerializer(RegisterSerializer): class RegistrationSerializer(RegisterSerializer):
name = serializers.CharField() name = serializers.CharField()
tour_step = serializers.CharField()
def get_cleaned_data(self): def get_cleaned_data(self):
return { return {
'first_name': self.validated_data.get('first_name', ''), 'first_name': self.validated_data.get('first_name', ''),
'last_name': self.validated_data.get('last_name', ''), 'last_name': self.validated_data.get('last_name', ''),
'name': self.validated_data.get('name', ''), 'name': self.validated_data.get('name', ''),
'tour_step': self.validated_data.get('tour_step', ''),
'username': self.validated_data.get('username', ''), 'username': self.validated_data.get('username', ''),
'password1': self.validated_data.get('password1', ''), 'password1': self.validated_data.get('password1', ''),
'email': self.validated_data.get('email', '') 'email': self.validated_data.get('email', '')
...@@ -40,7 +38,6 @@ class RegistrationSerializer(RegisterSerializer): ...@@ -40,7 +38,6 @@ class RegistrationSerializer(RegisterSerializer):
user = adapter.new_user(request) user = adapter.new_user(request)
self.cleaned_data = self.get_cleaned_data() self.cleaned_data = self.get_cleaned_data()
user.name = self.cleaned_data.get('name') user.name = self.cleaned_data.get('name')
user.tour_step = self.cleaned_data.get('tour_step')
adapter.save_user(request, user, self) adapter.save_user(request, user, self)
self.custom_signup(request, user) self.custom_signup(request, user)
setup_user_email(request, user, []) setup_user_email(request, user, [])
......
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