Spaces:
Sleeping
Sleeping
Asignacion de orden al catador para escalas
Browse files- tecnicas/controllers/__init__.py +2 -1
- tecnicas/controllers/main_tester_form_controller.py +48 -0
- tecnicas/controllers/presentador_controller.py +14 -0
- tecnicas/controllers/sesion_controller.py +28 -7
- tecnicas/controllers/tecnica_controller.py +8 -0
- tecnicas/middlewares/login_tester_middleware.py +4 -4
- tecnicas/static/img/check.svg +4 -0
- tecnicas/static/img/exit.svg +12 -0
- tecnicas/templates/tecnicas/forms_tester/main_tester.html +100 -1
- tecnicas/urls.py +1 -1
- tecnicas/utils/__init__.py +1 -0
- tecnicas/utils/shuffle_arrays.py +7 -0
- tecnicas/views/tester_forms/main_tester_form.py +26 -2
tecnicas/controllers/__init__.py
CHANGED
|
@@ -8,4 +8,5 @@ from .palabras_controller import PalabrasController
|
|
| 8 |
from .sesion_controller import SesionController
|
| 9 |
from .calificacion_controller import CalificacionController
|
| 10 |
from .detalles_sesion_controller import DetallesSesionController
|
| 11 |
-
from .login_tester_controller import LoginTesterController
|
|
|
|
|
|
| 8 |
from .sesion_controller import SesionController
|
| 9 |
from .calificacion_controller import CalificacionController
|
| 10 |
from .detalles_sesion_controller import DetallesSesionController
|
| 11 |
+
from .login_tester_controller import LoginTesterController
|
| 12 |
+
from .main_tester_form_controller import MainTesterFormController
|
tecnicas/controllers/main_tester_form_controller.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ..models import Catador, SesionSensorial, Orden
|
| 2 |
+
from ..utils import controller_error, shuffleArray
|
| 3 |
+
from django.db import transaction
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class MainTesterFormController():
|
| 7 |
+
tester: Catador
|
| 8 |
+
session: SesionSensorial
|
| 9 |
+
order: Orden | dict
|
| 10 |
+
|
| 11 |
+
def __init__(self, code_session: str, user_tester: str):
|
| 12 |
+
try:
|
| 13 |
+
self.tester = Catador.objects.get(usuarioCatador=user_tester)
|
| 14 |
+
self.session = SesionSensorial.objects.get(
|
| 15 |
+
codigo_sesion=code_session)
|
| 16 |
+
except (Catador.DoesNotExist, SesionSensorial.DoesNotExist):
|
| 17 |
+
return controller_error("Parámetros inexistentes")
|
| 18 |
+
|
| 19 |
+
def assignOrder(self):
|
| 20 |
+
self.checkAssignOrder()
|
| 21 |
+
if isinstance(self.order, Orden):
|
| 22 |
+
return self.order
|
| 23 |
+
|
| 24 |
+
with transaction.atomic():
|
| 25 |
+
orders_without_tester = Orden.objects.select_for_update().filter(
|
| 26 |
+
id_tecnica=self.session.tecnica, id_catador=None)
|
| 27 |
+
|
| 28 |
+
if not len(orders_without_tester):
|
| 29 |
+
return controller_error("Las ordenes se han acabado")
|
| 30 |
+
|
| 31 |
+
shuffle_orders = shuffleArray(orders_without_tester)
|
| 32 |
+
self.order_to_assign = shuffle_orders.pop()
|
| 33 |
+
|
| 34 |
+
self.order_to_assign.id_catador = self.tester
|
| 35 |
+
self.order_to_assign.save()
|
| 36 |
+
|
| 37 |
+
return self.order_to_assign
|
| 38 |
+
|
| 39 |
+
def checkAssignOrder(self):
|
| 40 |
+
if not self.tester or self.session:
|
| 41 |
+
return controller_error("Atributos no establecidos")
|
| 42 |
+
|
| 43 |
+
try:
|
| 44 |
+
res_order = Orden.objects.get(
|
| 45 |
+
id_tecnica=self.session.tecnica, id_catador=self.tester.id)
|
| 46 |
+
self.order = res_order
|
| 47 |
+
except Orden.DoesNotExist:
|
| 48 |
+
return controller_error("Catador sin orden")
|
tecnicas/controllers/presentador_controller.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ..models import Presentador
|
| 2 |
+
from ..utils import controller_error
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class PresentadorController():
|
| 6 |
+
def __init__(self):
|
| 7 |
+
pass
|
| 8 |
+
|
| 9 |
+
@staticmethod
|
| 10 |
+
def getPresenterByUsername(username: str):
|
| 11 |
+
try:
|
| 12 |
+
presenter = Presentador.objects.get(nombre_usuario=username)
|
| 13 |
+
except Presentador.DoesNotExist:
|
| 14 |
+
return controller_error("Presentador inexistente")
|
tecnicas/controllers/sesion_controller.py
CHANGED
|
@@ -54,7 +54,8 @@ class SesionController():
|
|
| 54 |
queryset = SesionSensorial.objects.select_related(
|
| 55 |
"tecnica",
|
| 56 |
"tecnica__tipo_tecnica",
|
| 57 |
-
"tecnica__id_estilo"
|
|
|
|
| 58 |
"codigo_sesion",
|
| 59 |
"nombre_sesion",
|
| 60 |
"fechaCreacion",
|
|
@@ -64,21 +65,41 @@ class SesionController():
|
|
| 64 |
|
| 65 |
paginator = Paginator(queryset, elements_by_page)
|
| 66 |
sessions_in_page = paginator.get_page(page)
|
|
|
|
|
|
|
| 67 |
except PageNotAnInteger:
|
| 68 |
return controller_error("indice invalido")
|
| 69 |
except EmptyPage:
|
| 70 |
return controller_error("sin registros de sessiones")
|
| 71 |
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
@staticmethod
|
| 75 |
def getNumberSessionsByCreator(user_name: str):
|
| 76 |
try:
|
| 77 |
creator = Presentador.objects.get(nombre_usuario=user_name)
|
| 78 |
-
except Presentador.DoesNotExist:
|
| 79 |
-
return controller_error("presentador invalido")
|
| 80 |
|
| 81 |
-
|
| 82 |
-
|
| 83 |
|
| 84 |
-
|
|
|
|
|
|
|
|
|
| 54 |
queryset = SesionSensorial.objects.select_related(
|
| 55 |
"tecnica",
|
| 56 |
"tecnica__tipo_tecnica",
|
| 57 |
+
"tecnica__id_estilo"
|
| 58 |
+
).only(
|
| 59 |
"codigo_sesion",
|
| 60 |
"nombre_sesion",
|
| 61 |
"fechaCreacion",
|
|
|
|
| 65 |
|
| 66 |
paginator = Paginator(queryset, elements_by_page)
|
| 67 |
sessions_in_page = paginator.get_page(page)
|
| 68 |
+
|
| 69 |
+
return sessions_in_page
|
| 70 |
except PageNotAnInteger:
|
| 71 |
return controller_error("indice invalido")
|
| 72 |
except EmptyPage:
|
| 73 |
return controller_error("sin registros de sessiones")
|
| 74 |
|
| 75 |
+
@staticmethod
|
| 76 |
+
def getSessionByCodePanelTester(code: str):
|
| 77 |
+
try:
|
| 78 |
+
session = SesionSensorial.objects.select_related(
|
| 79 |
+
"tecnica",
|
| 80 |
+
"tecnica__tipo_tecnica",
|
| 81 |
+
"tecnica__id_estilo"
|
| 82 |
+
).only(
|
| 83 |
+
"codigo_sesion",
|
| 84 |
+
"nombre_sesion",
|
| 85 |
+
"tecnica__repecion",
|
| 86 |
+
"tecnica__instrucciones",
|
| 87 |
+
"tecnica__tipo_tecnica__nombre_tecnica",
|
| 88 |
+
"tecnica__id_estilo__nombre_estilo"
|
| 89 |
+
).get(codigo_sesion=code)
|
| 90 |
+
|
| 91 |
+
return session
|
| 92 |
+
except SesionSensorial.DoesNotExist:
|
| 93 |
+
return controller_error("La sesión ya no existe")
|
| 94 |
|
| 95 |
@staticmethod
|
| 96 |
def getNumberSessionsByCreator(user_name: str):
|
| 97 |
try:
|
| 98 |
creator = Presentador.objects.get(nombre_usuario=user_name)
|
|
|
|
|
|
|
| 99 |
|
| 100 |
+
number_sessions = SesionSensorial.objects.filter(
|
| 101 |
+
creadoPor=creator).count()
|
| 102 |
|
| 103 |
+
return number_sessions/9
|
| 104 |
+
except Presentador.DoesNotExist:
|
| 105 |
+
return controller_error("presentador invalido")
|
tecnicas/controllers/tecnica_controller.py
CHANGED
|
@@ -35,6 +35,14 @@ class TecnicaController():
|
|
| 35 |
def deleteTechnique(self):
|
| 36 |
self.technique.delete()
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
@staticmethod
|
| 39 |
def getTypesTechnique():
|
| 40 |
showTecnicas = {}
|
|
|
|
| 35 |
def deleteTechnique(self):
|
| 36 |
self.technique.delete()
|
| 37 |
|
| 38 |
+
@staticmethod
|
| 39 |
+
def getTechniqueById(id: int):
|
| 40 |
+
try:
|
| 41 |
+
technique = Tecnica.objects.get(id)
|
| 42 |
+
return technique
|
| 43 |
+
except Tecnica.DoesNotExist:
|
| 44 |
+
return controller_error("Técnica no encontrada")
|
| 45 |
+
|
| 46 |
@staticmethod
|
| 47 |
def getTypesTechnique():
|
| 48 |
showTecnicas = {}
|
tecnicas/middlewares/login_tester_middleware.py
CHANGED
|
@@ -1,6 +1,4 @@
|
|
| 1 |
from django.http import HttpRequest
|
| 2 |
-
from django.shortcuts import redirect
|
| 3 |
-
from django.urls import reverse
|
| 4 |
|
| 5 |
|
| 6 |
class LoginTesterMiddleware():
|
|
@@ -8,10 +6,12 @@ class LoginTesterMiddleware():
|
|
| 8 |
self.get_response = get_response
|
| 9 |
|
| 10 |
def __call__(self, req: HttpRequest):
|
| 11 |
-
|
| 12 |
|
| 13 |
-
if req.path
|
| 14 |
if not "cata_username" in req.session:
|
|
|
|
|
|
|
| 15 |
return redirect(reverse("cata_system:catador_login"))
|
| 16 |
|
| 17 |
response = self.get_response(req)
|
|
|
|
| 1 |
from django.http import HttpRequest
|
|
|
|
|
|
|
| 2 |
|
| 3 |
|
| 4 |
class LoginTesterMiddleware():
|
|
|
|
| 6 |
self.get_response = get_response
|
| 7 |
|
| 8 |
def __call__(self, req: HttpRequest):
|
| 9 |
+
url_protected = "/cata/testers/"
|
| 10 |
|
| 11 |
+
if req.path.startswith(url_protected):
|
| 12 |
if not "cata_username" in req.session:
|
| 13 |
+
from django.shortcuts import redirect
|
| 14 |
+
from django.urls import reverse
|
| 15 |
return redirect(reverse("cata_system:catador_login"))
|
| 16 |
|
| 17 |
response = self.get_response(req)
|
tecnicas/static/img/check.svg
ADDED
|
|
tecnicas/static/img/exit.svg
ADDED
|
|
tecnicas/templates/tecnicas/forms_tester/main_tester.html
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{% extends 'tecnicas/layouts/base.html' %}
|
|
|
|
| 2 |
|
| 3 |
{% block title %}Detalles Sesion{% endblock %}
|
| 4 |
|
|
@@ -7,9 +8,107 @@
|
|
| 7 |
<article class="flex flex-col gap-8 bg-gray-400 p-10 rounded-2xl">
|
| 8 |
<header class="text-center flex-row w-full flex justify-around items-center flex-wrap gap-10">
|
| 9 |
<h1 class="text-white rounded-xl font-bold text-2xl bg-gray-600 p-4 flex-1">
|
| 10 |
-
|
| 11 |
</h1>
|
| 12 |
</header>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
</article>
|
| 14 |
</article>
|
| 15 |
{% endblock %}
|
|
|
|
| 1 |
{% extends 'tecnicas/layouts/base.html' %}
|
| 2 |
+
{% load static %}
|
| 3 |
|
| 4 |
{% block title %}Detalles Sesion{% endblock %}
|
| 5 |
|
|
|
|
| 8 |
<article class="flex flex-col gap-8 bg-gray-400 p-10 rounded-2xl">
|
| 9 |
<header class="text-center flex-row w-full flex justify-around items-center flex-wrap gap-10">
|
| 10 |
<h1 class="text-white rounded-xl font-bold text-2xl bg-gray-600 p-4 flex-1">
|
| 11 |
+
Panel principal de Catadores
|
| 12 |
</h1>
|
| 13 |
</header>
|
| 14 |
+
|
| 15 |
+
<article>
|
| 16 |
+
<p class="text-2xl font-medium text-center bg-gray-200 p-4 rounded-lg">
|
| 17 |
+
Información sobre la sesión en la que participa
|
| 18 |
+
</p>
|
| 19 |
+
</article>
|
| 20 |
+
|
| 21 |
+
{% if error %}
|
| 22 |
+
<hr>
|
| 23 |
+
|
| 24 |
+
<article class="bg-red-600 p-4 text-white rounded-xl ct-notification-error">
|
| 25 |
+
<p class="block font-sans text-white text-xl antialiased font-bold uppercase tracking-wider text-center">
|
| 26 |
+
{{ error }}
|
| 27 |
+
</p>
|
| 28 |
+
</article>
|
| 29 |
+
{% endif %}
|
| 30 |
+
|
| 31 |
+
<hr>
|
| 32 |
+
|
| 33 |
+
<article
|
| 34 |
+
class="text-white rounded-xl grid grid-cols-1 gap-3 text-center *:bg-gray-500 *:flex *:flex-wrap *:items-center *:justify-center *:gap-x-2 *:p-4 *:rounded-2xl">
|
| 35 |
+
{% if session %}
|
| 36 |
+
<section>
|
| 37 |
+
<p class="text-xl font-bold">
|
| 38 |
+
Código:
|
| 39 |
+
</p>
|
| 40 |
+
<p class="font-sans text-xl font-normal">
|
| 41 |
+
{{ session.codigo_sesion }}
|
| 42 |
+
</p>
|
| 43 |
+
</section>
|
| 44 |
+
|
| 45 |
+
<section>
|
| 46 |
+
<p class="text-xl font-bold">
|
| 47 |
+
{% if session.nombre_sesion %}
|
| 48 |
+
{{ session.nombre_sesion }}
|
| 49 |
+
{% else %}
|
| 50 |
+
Sin nombre
|
| 51 |
+
{% endif %}
|
| 52 |
+
</p>
|
| 53 |
+
</section>
|
| 54 |
+
|
| 55 |
+
<section>
|
| 56 |
+
<p class="text-xl font-medium">
|
| 57 |
+
Esta sesión usa la técnica <span class="uppercase">{{ session.tecnica.tipo_tecnica }}</span>
|
| 58 |
+
</p>
|
| 59 |
+
</section>
|
| 60 |
+
|
| 61 |
+
<section>
|
| 62 |
+
<p class="text-xl font-medium">
|
| 63 |
+
Esta sesión usa el estilo de palabras
|
| 64 |
+
“<span class="uppercase">{{ session.tecnica.id_estilo }}</span>”
|
| 65 |
+
</p>
|
| 66 |
+
</section>
|
| 67 |
+
|
| 68 |
+
<section>
|
| 69 |
+
<p class="text-xl font-medium">
|
| 70 |
+
Repetición número {{ session.tecnica.repecion }}
|
| 71 |
+
</p>
|
| 72 |
+
</section>
|
| 73 |
+
|
| 74 |
+
<section>
|
| 75 |
+
<p class="text-xl">
|
| 76 |
+
{{ session.tecnica.instrucciones }}
|
| 77 |
+
</p>
|
| 78 |
+
</section>
|
| 79 |
+
{% else %}
|
| 80 |
+
<section>
|
| 81 |
+
<p class="text-xl font-medium">
|
| 82 |
+
Ha ocurrido un error en renderizar esta vista
|
| 83 |
+
</p>
|
| 84 |
+
</section>
|
| 85 |
+
{% endif %}
|
| 86 |
+
</article>
|
| 87 |
+
|
| 88 |
+
<hr>
|
| 89 |
+
|
| 90 |
+
<article class="flex flex-wrap gap-10">
|
| 91 |
+
<a href="">
|
| 92 |
+
<button
|
| 93 |
+
class="ct-btn-start-repition flex-1 uppercase text-lg tracking-wider p-4 border-b-2 active:border-b-0 active:border-t-2 active:border-green-500 border-green-800 transition-all rounded-xl bg-green-600 text-white font-bold disabled:bg-amber-600 flex flex-col justify-center items-center gap-2">
|
| 94 |
+
Iniciar técnica
|
| 95 |
+
<figure class="w-10">
|
| 96 |
+
<img src="{% static 'img/check.svg' %}" alt="flechas girando" class="invert">
|
| 97 |
+
</figure>
|
| 98 |
+
</button>
|
| 99 |
+
</a>
|
| 100 |
+
<button
|
| 101 |
+
class="flex-1 uppercase text-lg tracking-wider p-4 border-b-2 active:border-b-0 active:border-t-2 active:border-red-500 border-red-800 transition-all rounded-xl bg-red-600 text-white font-bold disabled:bg-amber-600 flex flex-col justify-center items-center gap-2">
|
| 102 |
+
Salir se la sesión
|
| 103 |
+
<figure class="w-10">
|
| 104 |
+
<img src="{% static 'img/exit.svg' %}" alt="bote de basura" class="invert">
|
| 105 |
+
</figure>
|
| 106 |
+
</button>
|
| 107 |
+
</article>
|
| 108 |
+
|
| 109 |
+
<form action="" method="post" class="hidden">
|
| 110 |
+
<input type="hidden" value="start_posting" name="action">
|
| 111 |
+
</form>
|
| 112 |
</article>
|
| 113 |
</article>
|
| 114 |
{% endblock %}
|
tecnicas/urls.py
CHANGED
|
@@ -68,7 +68,7 @@ urlpatterns = [
|
|
| 68 |
views.testerLogin,
|
| 69 |
name="catador_login"),
|
| 70 |
|
| 71 |
-
path("catador-main",
|
| 72 |
views.mainTesterForm,
|
| 73 |
name="catador_main"),
|
| 74 |
|
|
|
|
| 68 |
views.testerLogin,
|
| 69 |
name="catador_login"),
|
| 70 |
|
| 71 |
+
path("testers/catador-main",
|
| 72 |
views.mainTesterForm,
|
| 73 |
name="catador_main"),
|
| 74 |
|
tecnicas/utils/__init__.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
from .code_generate import generarCodigo
|
| 2 |
from .code_generate import generarCodigos
|
| 3 |
from .personal_errors import general_error, controller_error
|
|
|
|
|
|
| 1 |
from .code_generate import generarCodigo
|
| 2 |
from .code_generate import generarCodigos
|
| 3 |
from .personal_errors import general_error, controller_error
|
| 4 |
+
from .shuffle_arrays import shuffleArray
|
tecnicas/utils/shuffle_arrays.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import random
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def shuffleArray(obj_list: list):
|
| 5 |
+
new_obj_list = obj_list[:]
|
| 6 |
+
random.shuffle(new_obj_list)
|
| 7 |
+
return new_obj_list
|
tecnicas/views/tester_forms/main_tester_form.py
CHANGED
|
@@ -1,9 +1,33 @@
|
|
| 1 |
from django.http import HttpRequest, JsonResponse
|
| 2 |
from django.shortcuts import render
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
def mainTesterForm(req: HttpRequest):
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
else:
|
| 9 |
return JsonResponse({"error": "metodo no permitido"})
|
|
|
|
| 1 |
from django.http import HttpRequest, JsonResponse
|
| 2 |
from django.shortcuts import render
|
| 3 |
+
from ...controllers import SesionController, MainTesterFormController
|
| 4 |
|
| 5 |
|
| 6 |
def mainTesterForm(req: HttpRequest):
|
| 7 |
+
session = SesionController.getSessionByCodePanelTester(
|
| 8 |
+
req.session["code_session"])
|
| 9 |
+
|
| 10 |
+
context = {
|
| 11 |
+
"session": session
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
if req.method == "GET":
|
| 15 |
+
return render(req, "tecnicas/forms_tester/main_tester.html", context)
|
| 16 |
+
elif req.method == "POST":
|
| 17 |
+
if req.POST["action"] == "start_posting":
|
| 18 |
+
view_controller = MainTesterFormController(
|
| 19 |
+
req.session["code_session"], req.session["cata_username"])
|
| 20 |
+
|
| 21 |
+
order = view_controller.assignOrder()
|
| 22 |
+
if isinstance(order, dict):
|
| 23 |
+
context["error"] = order["error"]
|
| 24 |
+
return render(req, "tecnicas/forms_tester/main_tester.html", context)
|
| 25 |
+
|
| 26 |
+
return render(req, "tecnicas/forms_tester/main_tester.html", context)
|
| 27 |
+
elif req.POST["action"] == "close_session":
|
| 28 |
+
pass
|
| 29 |
+
else:
|
| 30 |
+
context["error"] = "Acción sin especificar"
|
| 31 |
+
return render(req, "tecnicas/forms_tester/main_tester.html", context)
|
| 32 |
else:
|
| 33 |
return JsonResponse({"error": "metodo no permitido"})
|