Spaces:
Sleeping
Sleeping
Se manda mensaje de error por credenciales invalidas presentador
Browse files
tecnicas/views/autentication.py
CHANGED
|
@@ -1,9 +1,8 @@
|
|
| 1 |
from django.contrib.auth import authenticate, login
|
| 2 |
-
from django.http import HttpRequest
|
| 3 |
from django.views.decorators.csrf import csrf_exempt
|
| 4 |
from django.shortcuts import render, redirect
|
| 5 |
from tecnicas.utils import general_error
|
| 6 |
-
from tecnicas.models import Presentador
|
| 7 |
|
| 8 |
@csrf_exempt
|
| 9 |
def autentication(req: HttpRequest):
|
|
@@ -21,9 +20,7 @@ def autentication(req: HttpRequest):
|
|
| 21 |
login(req, user)
|
| 22 |
return redirect("cata_system:index")
|
| 23 |
else:
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
"error": "Credenciales inválidas o no es un Presentador"
|
| 27 |
-
})
|
| 28 |
else:
|
| 29 |
return general_error("Método no permitido")
|
|
|
|
| 1 |
from django.contrib.auth import authenticate, login
|
| 2 |
+
from django.http import HttpRequest
|
| 3 |
from django.views.decorators.csrf import csrf_exempt
|
| 4 |
from django.shortcuts import render, redirect
|
| 5 |
from tecnicas.utils import general_error
|
|
|
|
| 6 |
|
| 7 |
@csrf_exempt
|
| 8 |
def autentication(req: HttpRequest):
|
|
|
|
| 20 |
login(req, user)
|
| 21 |
return redirect("cata_system:index")
|
| 22 |
else:
|
| 23 |
+
context_view["error"] = "Credenciales inválidas o no es un Presentador"
|
| 24 |
+
return render(req, "tecnicas/auth.html", context_view)
|
|
|
|
|
|
|
| 25 |
else:
|
| 26 |
return general_error("Método no permitido")
|