diff --git a/user/admin.py b/user/admin.py index 8621d33..a6d76d9 100644 --- a/user/admin.py +++ b/user/admin.py @@ -37,13 +37,13 @@ class UserAdminConfig(UserAdmin): fieldsets = ( (None , {'fields' : ('email','user_name','first_name','password')}), ('permissions' , {'fields' : ('is_staff','is_active')}), - ('personal',{'fields':('phone_number','about','profile')}), + ('personal',{'fields':('phone_number','about','profile','favorite_game_title')}), ('team' , {'fields':('team' , 'team_role')}) ) add_fieldsets = ( (None , {'fields' : ('email','user_name','first_name','password')}), ('permissions' , {'fields' : ('is_staff','is_active')}), - ('personal',{'fields':('phone_number','about','profile')}), + ('personal',{'fields':('phone_number','about','profile','favorite_game_title')}), ('team' , {'fields':('team' , 'team_role')}) ) diff --git a/user/models.py b/user/models.py index 83914b3..453b583 100644 --- a/user/models.py +++ b/user/models.py @@ -107,6 +107,7 @@ class SiteUser(AbstractBaseUser, PermissionsMixin): activation_code = models.CharField(max_length=64, blank=True) team = models.ForeignKey(Team, on_delete=models.SET_NULL, null=True, blank=True, related_name='members') team_role = models.CharField(choices=TEAM_MEMBER_ROLE, default='NO', max_length=2) + favorite_game_title = models.CharField(max_length=50, blank=True) # event informations phone_number = models.CharField(_("phone number"), validators=[PhoneValidator()], max_length=32, blank=False, null=False) diff --git a/user/serializers.py b/user/serializers.py index 8e07248..8b03bb2 100644 --- a/user/serializers.py +++ b/user/serializers.py @@ -22,7 +22,7 @@ class CustomUserSerializer(serializers.ModelSerializer): class Meta: model = get_user_model() fields = ('team_role', 'team', 'email', 'user_name', 'password', - 'first_name', 'phone_number', 'profile', 'is_staff') + 'first_name', 'phone_number', 'profile', 'is_staff', 'favorite_game_title') extra_kwargs = {'password': {'write_only': True}} def create(self, validated_data):