add telegram

This commit is contained in:
Administrator
2023-10-11 18:37:39 +03:00
parent 319bed3dfc
commit f1f7c0e89b
5 changed files with 61 additions and 2 deletions

View File

@@ -1,4 +1,3 @@
from django.db.models import Q
from django.http import HttpResponse, JsonResponse
from Platform import settings
@@ -18,6 +17,9 @@ def is_staff(request):
email = request.GET.get('email')
if email:
data['email'] = email
telegram_id = request.GET.get('telegram_id')
if telegram_id:
data['telegram_id'] = telegram_id
for key, value in data.items():
if len(CustomUser.objects.filter(**{key: value})) != 0:
return JsonResponse({'is_staff': True})