Browse Source

fix: country

master
alireza 1 year ago
parent
commit
2e8cb2506e
  1. 18
      apps/account/migrations/0006_user_country.py
  2. 2
      apps/account/models/user.py
  3. 2
      apps/account/serializers/user.py
  4. 18
      apps/certificate/migrations/0002_alter_certificate_status.py

18
apps/account/migrations/0006_user_country.py

@ -0,0 +1,18 @@
# Generated by Django 3.2.7 on 2024-12-17 16:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0005_user_city'),
]
operations = [
migrations.AddField(
model_name='user',
name='country',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='country'),
),
]

2
apps/account/models/user.py

@ -43,6 +43,8 @@ class User(AbstractUser):
help_text="Type of the user."
)
city = models.CharField(verbose_name=_('City'), max_length=255, null=True, blank=True)
country = models.CharField(max_length=255, verbose_name=_('country'), null=True, blank=True)
device_id = models.CharField(verbose_name=_('device id'), max_length=255, null=True, blank=True)
fcm = models.CharField(max_length=512, null=True, blank=True)
date_joined = models.DateTimeField(auto_now_add=True, verbose_name="Date Joined", help_text="The date and time the user registered.")

2
apps/account/serializers/user.py

@ -20,7 +20,7 @@ class UserProfileSerializer(serializers.ModelSerializer):
)
class Meta:
model = User
fields = ['id', 'fullname', 'avatar', 'email', 'phone_number', 'password', 'info', 'skill', 'city', 'birthdate', 'gender']
fields = ['id', 'fullname', 'avatar', 'email', 'phone_number', 'password', 'info', 'skill', 'city', 'country', 'birthdate', 'gender']
read_only_fields = ['email', 'info', 'skill']
# def validate_email(self, value):

18
apps/certificate/migrations/0002_alter_certificate_status.py

@ -0,0 +1,18 @@
# Generated by Django 3.2.7 on 2024-12-17 16:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('certificate', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='certificate',
name='status',
field=models.CharField(choices=[('pending', 'pending'), ('approved', 'approved'), ('canceled', 'canceled')], default='pending', max_length=10),
),
]
Loading…
Cancel
Save