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

@ -8,11 +8,11 @@ from django.utils import timezone
from rest_framework_simplejwt.tokens import RefreshToken
"""Import django app"""
from account.utils import send_otp_email, generate_alphanumeric_code
from account.utils import send_otp_email, generate_code
from junior.models import Junior, JuniorPoints
from guardian.tasks import generate_otp
from base.messages import ERROR_CODE, SUCCESS_CODE
from base.constants import PENDING, IN_PROGRESS, REJECTED, REQUESTED, COMPLETED, NUMBER
from base.constants import PENDING, IN_PROGRESS, REJECTED, REQUESTED, COMPLETED, NUMBER, JUN, ZOD
from guardian.models import Guardian, JuniorTask
from account.models import UserEmailOtp
from junior.utils import junior_notification_email, junior_approval_mail
@ -275,8 +275,8 @@ class AddJuniorSerializer(serializers.ModelSerializer):
junior_data = Junior.objects.create(auth=user_data, gender=validated_data.get('gender'),
dob=validated_data.get('dob'), is_invited=True,
relationship=validated_data.get('relationship'),
junior_code=generate_alphanumeric_code(6),
referral_code=generate_alphanumeric_code(6),
junior_code=generate_code(JUN, user_data.id),
referral_code=generate_code(ZOD, user_data.id),
referral_code_used=guardian_data.referral_code)
"""Generate otp"""
otp_value = generate_otp()