mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-15 18:07:02 +00:00
Merge branch 'qa' of github.com:KiwiTechLLC/ZODBank-Backend into qa
This commit is contained in:
@ -57,7 +57,7 @@ SUCCESS_CODE = {
|
|||||||
# Success code for Thank you
|
# Success code for Thank you
|
||||||
"3002": "Thank you for contacting us! Our Consumer Experience Team will reach out to you shortly.",
|
"3002": "Thank you for contacting us! Our Consumer Experience Team will reach out to you shortly.",
|
||||||
# Success code for account activation
|
# Success code for account activation
|
||||||
"3003": "Log in successfully",
|
"3003": "Log in successful",
|
||||||
# Success code for password reset
|
# Success code for password reset
|
||||||
"3004": "Password reset link has been sent to your email address",
|
"3004": "Password reset link has been sent to your email address",
|
||||||
# Success code for link verified
|
# Success code for link verified
|
||||||
|
18
guardian/migrations/0007_alter_guardian_country_name.py
Normal file
18
guardian/migrations/0007_alter_guardian_country_name.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.2 on 2023-06-30 10:53
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('guardian', '0006_guardian_is_verified'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='guardian',
|
||||||
|
name='country_name',
|
||||||
|
field=models.CharField(blank=True, default=None, max_length=100, null=True),
|
||||||
|
),
|
||||||
|
]
|
@ -13,7 +13,7 @@ class Guardian(models.Model):
|
|||||||
"""Contact details"""
|
"""Contact details"""
|
||||||
country_code = models.IntegerField(blank=True, null=True)
|
country_code = models.IntegerField(blank=True, null=True)
|
||||||
phone = models.CharField(max_length=31, null=True, blank=True, default=None)
|
phone = models.CharField(max_length=31, null=True, blank=True, default=None)
|
||||||
country_name = models.CharField(max_length=30, null=True, blank=True, default=None)
|
country_name = models.CharField(max_length=100, null=True, blank=True, default=None)
|
||||||
"""Image info"""
|
"""Image info"""
|
||||||
image = models.ImageField(null=True, blank=True, default=None)
|
image = models.ImageField(null=True, blank=True, default=None)
|
||||||
"""Personal info"""
|
"""Personal info"""
|
||||||
|
@ -86,11 +86,11 @@ class CreateGuardianSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
"""Create guardian profile"""
|
"""Create guardian profile"""
|
||||||
phone_number = validated_data.get('phone', None)
|
# phone_number = validated_data.get('phone', None)
|
||||||
guardian_data = Guardian.objects.filter(phone=phone_number)
|
# guardian_data = Guardian.objects.filter(phone=phone_number)
|
||||||
junior_data = Junior.objects.filter(phone=phone_number)
|
# junior_data = Junior.objects.filter(phone=phone_number)
|
||||||
if phone_number and (guardian_data or junior_data):
|
# if phone_number and (guardian_data or junior_data):
|
||||||
raise serializers.ValidationError({"details": ERROR_CODE['2012']})
|
# raise serializers.ValidationError({"details": ERROR_CODE['2012']})
|
||||||
user = User.objects.filter(username=self.context['user']).last()
|
user = User.objects.filter(username=self.context['user']).last()
|
||||||
if user:
|
if user:
|
||||||
"""Save first and last name of guardian"""
|
"""Save first and last name of guardian"""
|
||||||
|
18
junior/migrations/0006_alter_junior_country_name.py
Normal file
18
junior/migrations/0006_alter_junior_country_name.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.2 on 2023-06-30 10:53
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('junior', '0005_junior_is_verified'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='junior',
|
||||||
|
name='country_name',
|
||||||
|
field=models.CharField(blank=True, default=None, max_length=100, null=True),
|
||||||
|
),
|
||||||
|
]
|
@ -14,7 +14,7 @@ class Junior(models.Model):
|
|||||||
"""Contact details"""
|
"""Contact details"""
|
||||||
phone = models.CharField(max_length=31, null=True, blank=True, default=None)
|
phone = models.CharField(max_length=31, null=True, blank=True, default=None)
|
||||||
country_code = models.IntegerField(blank=True, null=True)
|
country_code = models.IntegerField(blank=True, null=True)
|
||||||
country_name = models.CharField(max_length=30, null=True, blank=True, default=None)
|
country_name = models.CharField(max_length=100, null=True, blank=True, default=None)
|
||||||
"""Personal info"""
|
"""Personal info"""
|
||||||
gender = models.CharField(max_length=10, choices=GENDERS, null=True, blank=True, default=None)
|
gender = models.CharField(max_length=10, choices=GENDERS, null=True, blank=True, default=None)
|
||||||
dob = models.DateField(max_length=15, null=True, blank=True, default=None)
|
dob = models.DateField(max_length=15, null=True, blank=True, default=None)
|
||||||
|
@ -59,11 +59,11 @@ class CreateJuniorSerializer(serializers.ModelSerializer):
|
|||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
"""Create junior profile"""
|
"""Create junior profile"""
|
||||||
image = validated_data.get('image', None)
|
image = validated_data.get('image', None)
|
||||||
phone_number = validated_data.get('phone', None)
|
# phone_number = validated_data.get('phone', None)
|
||||||
guardian_data = Guardian.objects.filter(phone=phone_number)
|
# guardian_data = Guardian.objects.filter(phone=phone_number)
|
||||||
junior_data = Junior.objects.filter(phone=phone_number)
|
# junior_data = Junior.objects.filter(phone=phone_number)
|
||||||
if phone_number and (junior_data or guardian_data):
|
# if phone_number and (junior_data or guardian_data):
|
||||||
raise serializers.ValidationError({"details":ERROR_CODE['2012']})
|
# raise serializers.ValidationError({"details":ERROR_CODE['2012']})
|
||||||
user = User.objects.filter(username=self.context['user']).last()
|
user = User.objects.filter(username=self.context['user']).last()
|
||||||
if user:
|
if user:
|
||||||
"""Save first and last name of junior"""
|
"""Save first and last name of junior"""
|
||||||
|
Reference in New Issue
Block a user