mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
refactor: Mise à jour de la doc swagger / URL
This commit is contained in:
@ -40,8 +40,8 @@ class SessionView(APIView):
|
||||
try:
|
||||
decoded_token = jwt.decode(token, settings.SECRET_KEY, algorithms=['HS256'])
|
||||
print(f'decode : {decoded_token}')
|
||||
user_id = decoded_token.get('id')
|
||||
user = Profile.objects.get(id=user_id)
|
||||
userid = decoded_token.get('id')
|
||||
user = Profile.objects.get(id=userid)
|
||||
|
||||
response_data = {
|
||||
'user': {
|
||||
@ -84,7 +84,7 @@ class ProfileSimpleView(APIView):
|
||||
|
||||
def put(self, request, id):
|
||||
data=JSONParser().parse(request)
|
||||
profil = Profile.objects.get(id=_id)
|
||||
profil = Profile.objects.get(id=id)
|
||||
profil_serializer = ProfilUpdateSerializer(profil, data=data)
|
||||
if profil_serializer.is_valid():
|
||||
profil_serializer.save()
|
||||
@ -108,7 +108,7 @@ class LoginView(APIView):
|
||||
def post(self, request):
|
||||
data=JSONParser().parse(request)
|
||||
validatorAuthentication = validator.ValidatorAuthentication(data=data)
|
||||
retour = error.returnMessage[error.WRONG_ID]
|
||||
retour = error.returnMessage[error.WRONGid]
|
||||
validationOk, errorFields = validatorAuthentication.validate()
|
||||
user = None
|
||||
if validationOk:
|
||||
@ -133,7 +133,7 @@ class LoginView(APIView):
|
||||
# 'role': "admin"
|
||||
# }, settings.SECRET_KEY, algorithm='HS256')
|
||||
else:
|
||||
retour = error.returnMessage[error.WRONG_ID]
|
||||
retour = error.returnMessage[error.WRONGid]
|
||||
|
||||
|
||||
return JsonResponse({
|
||||
|
||||
Reference in New Issue
Block a user