backend #2
Binary file not shown.
@ -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
|
||||||
|
|
||||||
|
Binary file not shown.
@ -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',
|
||||||
|
),
|
||||||
|
]
|
@ -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:
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user