mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
feat: Gestion de la création d'un nouveau guardian, de l'association
avec un guardian dumême établissement, et de l'association avec un guardian d'un autre établissement
This commit is contained in:
@ -4,7 +4,6 @@ from django.http.response import JsonResponse
|
||||
from django.views.decorators.csrf import ensure_csrf_cookie, csrf_exempt, csrf_protect
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.cache import cache
|
||||
from django.middleware.csrf import get_token
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework.parsers import JSONParser
|
||||
@ -24,7 +23,6 @@ from rest_framework.decorators import action, api_view
|
||||
|
||||
from Auth.serializers import ProfileSerializer, ProfileRoleSerializer
|
||||
from Subscriptions.models import RegistrationForm
|
||||
from Subscriptions.signals import clear_cache
|
||||
import Subscriptions.mailManager as mailer
|
||||
import Subscriptions.util as util
|
||||
import logging
|
||||
@ -204,7 +202,6 @@ class LoginView(APIView):
|
||||
|
||||
login(request, user)
|
||||
user.save()
|
||||
clear_cache()
|
||||
retour = ''
|
||||
|
||||
# Récupérer tous les rôles de l'utilisateur avec le type spécifié
|
||||
@ -423,7 +420,6 @@ class SubscribeView(APIView):
|
||||
else:
|
||||
return JsonResponse(role_serializer.errors, safe=False, status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
clear_cache()
|
||||
retour = error.returnMessage[error.MESSAGE_ACTIVATION_PROFILE]
|
||||
retourErreur = ''
|
||||
return JsonResponse({'message': retour, 'errorMessage': retourErreur, "errorFields": errorFields, "id": profil.id}, safe=False)
|
||||
@ -473,7 +469,6 @@ class NewPasswordView(APIView):
|
||||
profil.code = util.genereRandomCode(12)
|
||||
profil.datePeremption = util.calculeDatePeremption(util._now(), settings.EXPIRATION_URL_NB_DAYS)
|
||||
profil.save()
|
||||
clear_cache()
|
||||
retourErreur = ''
|
||||
retour = error.returnMessage[error.MESSAGE_REINIT_PASSWORD] % (newProfilConnection.get('email'))
|
||||
mailer.envoieReinitMotDePasse(newProfilConnection.get('email'), profil.code)
|
||||
@ -527,7 +522,6 @@ class ResetPasswordView(APIView):
|
||||
profil.code = ''
|
||||
profil.datePeremption = ''
|
||||
profil.save()
|
||||
clear_cache()
|
||||
retourErreur = ''
|
||||
|
||||
return JsonResponse({'message': retour, "errorMessage": retourErreur, "errorFields": errorFields}, safe=False)
|
||||
|
||||
Reference in New Issue
Block a user