mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 16:44:54 +00:00
swagger points
This commit is contained in:
@ -7,7 +7,7 @@ from rest_framework_simplejwt.tokens import RefreshToken
|
||||
"""App import"""
|
||||
from guardian.models import Guardian
|
||||
from junior.models import Junior
|
||||
from account.models import UserEmailOtp, DefaultTaskImages, UserDelete, UserNotification
|
||||
from account.models import UserEmailOtp, DefaultTaskImages, UserDelete, UserNotification, UserPhoneOtp
|
||||
from base.constants import GUARDIAN, JUNIOR, SUPERUSER
|
||||
from base.messages import ERROR_CODE_REQUIRED, ERROR_CODE, SUCCESS_CODE, STATUS_CODE_ERROR
|
||||
|
||||
@ -233,7 +233,7 @@ class UserDeleteSerializer(serializers.ModelSerializer):
|
||||
passwd = self.context['password']
|
||||
random_num = random.randint(0,10000)
|
||||
user_tb = User.objects.filter(id=user.id).last()
|
||||
if user_tb.check_password(passwd):
|
||||
if user_tb and user_tb.check_password(passwd):
|
||||
user_type_data = UserEmailOtp.objects.filter(email=user.email).last()
|
||||
if user_type == '1' and user_type_data.user_type == '1':
|
||||
junior_data = Junior.objects.filter(auth__email=user_tb.email).first()
|
||||
@ -291,3 +291,9 @@ class UpdateUserNotificationSerializer(serializers.ModelSerializer):
|
||||
instance.sms_notification = validated_data.get('sms_notification', instance.sms_notification)
|
||||
instance.save()
|
||||
return instance
|
||||
|
||||
class UserPhoneOtpSerializer(serializers.ModelSerializer):
|
||||
"""User Phone serializers"""
|
||||
class Meta(object):
|
||||
model = UserPhoneOtp
|
||||
fields = '__all__'
|
||||
|
||||
Reference in New Issue
Block a user