sonar issues

This commit is contained in:
jain
2023-07-14 12:05:28 +05:30
parent 5d528b885a
commit 7b9b5a2c6f
11 changed files with 77 additions and 48 deletions

View File

@ -1,10 +1,13 @@
"""Junior model """
"""Import django"""
from django.db import models
"""Import get_user_model function"""
from django.contrib.auth import get_user_model
"""Import ArrayField"""
from django.contrib.postgres.fields import ArrayField
"""Import django app"""
from base.constants import GENDERS, SIGNUP_METHODS, RELATIONSHIP
"""Define User model"""
User = get_user_model()
# Create your models here.
@ -14,10 +17,13 @@ class Junior(models.Model):
"""Contact details"""
phone = models.CharField(max_length=31, null=True, blank=True, default=None)
country_code = models.IntegerField(blank=True, null=True)
"""country name of the guardian"""
country_name = models.CharField(max_length=100, null=True, blank=True, default=None)
"""Personal info"""
gender = models.CharField(max_length=10, choices=GENDERS, null=True, blank=True, default=None)
"""Date of birth"""
dob = models.DateField(max_length=15, null=True, blank=True, default=None)
"""Image of the junior"""
image = models.URLField(null=True, blank=True, default=None)
"""relationship"""
relationship = models.CharField(max_length=31, choices=RELATIONSHIP, null=True, blank=True,
@ -26,15 +32,21 @@ class Junior(models.Model):
signup_method = models.CharField(max_length=31, choices=SIGNUP_METHODS, default='1')
"""Codes"""
junior_code = models.CharField(max_length=10, null=True, blank=True, default=None)
"""Guardian Codes"""
guardian_code = ArrayField(models.CharField(max_length=10, null=True, blank=True, default=None),null=True)
"""Referral code"""
referral_code = models.CharField(max_length=10, null=True, blank=True, default=None)
"""Referral code that is used by junior while signup"""
referral_code_used = models.CharField(max_length=10, null=True, blank=True, default=None)
"""invited junior"""
is_invited = models.BooleanField(default=False)
"""Profile activity"""
is_active = models.BooleanField(default=True)
"""junior profile is complete or not"""
is_complete_profile = models.BooleanField(default=False)
"""passcode of the junior profile"""
passcode = models.IntegerField(null=True, blank=True, default=None)
"""junior is verified or not"""
is_verified = models.BooleanField(default=False)
"""Profile created and updated time"""
created_at = models.DateTimeField(auto_now_add=True)
@ -44,6 +56,8 @@ class Junior(models.Model):
""" Meta class """
db_table = 'junior'
verbose_name = 'Junior'
"""another name of the model"""
verbose_name_plural = 'Junior'
def __str__(self):
"""Return email id"""
@ -64,6 +78,8 @@ class JuniorPoints(models.Model):
""" Meta class """
db_table = 'junior_task_points'
verbose_name = 'Junior Task Points'
"""another name of the model"""
verbose_name_plural = 'Junior Task Points'
def __str__(self):
"""Return email id"""