backend #2

Merged
s460930 merged 5 commits from backend into develop 2020-12-05 19:08:57 +01:00
5 changed files with 21 additions and 4 deletions
Showing only changes of commit 18957651b8 - Show all commits

Binary file not shown.

View File

@ -20,7 +20,7 @@ class UserSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = UserProfile model = UserProfile
fields = ('first_name', 'last_name', 'phone_number') fields = ('first_name', 'last_name')
class UserRegistrationSerializer(serializers.ModelSerializer): class UserRegistrationSerializer(serializers.ModelSerializer):
@ -40,8 +40,7 @@ class UserRegistrationSerializer(serializers.ModelSerializer):
UserProfile.objects.create( UserProfile.objects.create(
user=user, user=user,
first_name=profile_data['first_name'], first_name=profile_data['first_name'],
last_name=profile_data['last_name'], last_name=profile_data['last_name']
phone_number=profile_data['phone_number'],
) )
return user return user

View File

@ -0,0 +1,19 @@
# Generated by Django 3.1.3 on 2020-12-01 21:54
from django.db import migrations
class Migration(migrations.Migration):
atomic = False
dependencies = [
('user_profile', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='userprofile',
name='phone_number',
),
]

View File

@ -15,7 +15,6 @@ class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile') user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
first_name = models.CharField(max_length=50, unique=False) first_name = models.CharField(max_length=50, unique=False)
last_name = models.CharField(max_length=50, unique=False) last_name = models.CharField(max_length=50, unique=False)
phone_number = models.CharField(max_length=10, unique=False, null=True, blank=True)
class Meta: class Meta:
""" """