mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2026-10-23 14:27:56 +00:00
Compare commits
56
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7c55f2a04 | ||
|
|
bcf308b6eb | ||
|
|
74328f37b2 | ||
|
|
d29a60558f | ||
|
|
451c3bdae7 | ||
|
|
54748a6704 | ||
|
|
d8f4467d98 | ||
|
|
7c809776b6 | ||
|
|
74e704570a | ||
|
|
a9cc05c675 | ||
|
|
adb827f5a0 | ||
|
|
a02dfd4e31 | ||
|
|
08dc9f8538 | ||
|
|
136d0b732a | ||
|
|
83d7d119be | ||
|
|
a1d959299a | ||
|
|
b974cc2010 | ||
|
|
19a6475097 | ||
|
|
4ca60af5da | ||
|
|
807526acfa | ||
|
|
f4149379c2 | ||
|
|
b8f1acaed8 | ||
|
|
9e5dd5e3d5 | ||
|
|
b961044e4d | ||
|
|
2498394127 | ||
|
|
2fc65d462d | ||
|
|
cdf656fdad | ||
|
|
8eaf8751c2 | ||
|
|
6867920754 | ||
|
|
22ba4288d9 | ||
|
|
7ab16cb3de | ||
|
|
07d150309b | ||
|
|
3801e6e027 | ||
|
|
e89fc513cb | ||
|
|
e1af1c200d | ||
|
|
4fddc7b3e2 | ||
|
|
b238379a22 | ||
|
|
ed18758cc5 | ||
|
|
c081bc621d | ||
|
|
d2c8b18e3f | ||
|
|
bdc0ba4fd5 | ||
|
|
3af2584d6a | ||
|
|
62cf2b14bf | ||
|
|
cbd3d139a5 | ||
|
|
7cb792c6cf | ||
|
|
5ea28bbd75 | ||
|
|
180104ece8 | ||
|
|
fb74c6c207 | ||
|
|
87cb49d34d | ||
|
|
4261b5ad29 | ||
|
|
6c0c3e0aca | ||
|
|
c6b220d6f2 | ||
|
|
b5b793dc88 | ||
|
|
1b5019e347 | ||
|
|
8c1e96a3df | ||
|
|
545fa8229b |
+3
-4
@@ -7,7 +7,6 @@ from notifications.utils import remove_fcm_token
|
||||
from datetime import datetime, timedelta
|
||||
from rest_framework import viewsets, status, views
|
||||
from rest_framework.decorators import action
|
||||
import random
|
||||
import logging
|
||||
from django.utils import timezone
|
||||
import jwt
|
||||
@@ -295,7 +294,7 @@ class UserLogin(viewsets.ViewSet):
|
||||
try:
|
||||
if user is not None:
|
||||
login(request, user)
|
||||
if user_type == USER_TYPE_FLAG["TWO"]:
|
||||
if str(user_type) == USER_TYPE_FLAG["TWO"]:
|
||||
guardian_data = Guardian.objects.filter(user__username=username, is_verified=True).last()
|
||||
if guardian_data:
|
||||
serializer = GuardianSerializer(
|
||||
@@ -306,7 +305,7 @@ class UserLogin(viewsets.ViewSet):
|
||||
ERROR_CODE["2070"],
|
||||
response_status=status.HTTP_401_UNAUTHORIZED
|
||||
)
|
||||
elif user_type == USER_TYPE_FLAG["FIRST"]:
|
||||
elif str(user_type) == USER_TYPE_FLAG["FIRST"]:
|
||||
junior_data = Junior.objects.filter(auth__username=username, is_verified=True).last()
|
||||
if junior_data:
|
||||
serializer = JuniorSerializer(
|
||||
@@ -536,7 +535,7 @@ class UserNotificationAPIViewSet(viewsets.ModelViewSet):
|
||||
permission_classes = [IsAuthenticated]
|
||||
def list(self, request, *args, **kwargs):
|
||||
"""profile view"""
|
||||
queryset = self.queryset.filter(user=request.user)
|
||||
queryset = UserNotification.objects.filter(user=request.user)
|
||||
serializer = UserNotificationSerializer(queryset, many=True)
|
||||
return custom_response(None, serializer.data, response_status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ class RemoveJuniorSerializer(serializers.ModelSerializer):
|
||||
if instance:
|
||||
instance.is_invited = False
|
||||
instance.guardian_code = '{}'
|
||||
instance.guardian_code_status = str(NUMBER['1'])
|
||||
instance.guardian_code_status = str(NUMBER['one'])
|
||||
instance.save()
|
||||
return instance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user