From 923915a29bcf7c36ff200398ea9f9c76d213ee3a Mon Sep 17 00:00:00 2001 From: AdalbertoCV <34152734@uaz.edu.mx> Date: Thu, 26 Sep 2024 18:54:07 -0600 Subject: [PATCH] token timelife actualizado + configuracion de non-editable fields en Solicitudes --- cosiap_api/cosiap_api/settings.py | 2 +- cosiap_api/solicitudes/views.py | 4 ++- .../modalidades/EditarModalidad.jsx | 12 +++---- .../modalidades/ListaModalidades.jsx | 33 +++++++++++-------- 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/cosiap_api/cosiap_api/settings.py b/cosiap_api/cosiap_api/settings.py index 6776ca3..578ef64 100644 --- a/cosiap_api/cosiap_api/settings.py +++ b/cosiap_api/cosiap_api/settings.py @@ -196,7 +196,7 @@ SESSION_COOKIE_SECURE = True SESSION_COOKIE_HTTPONLY = True SIMPLE_JWT = { - 'ACCESS_TOKEN_LIFETIME': timedelta(minutes=3), + 'ACCESS_TOKEN_LIFETIME': timedelta(days=1), 'REFRESH_TOKEN_LIFETIME': timedelta(days=1), 'ROTATE_REFRESH_TOKENS': False, 'BLACKLIST_AFTER_ROTATION': False, diff --git a/cosiap_api/solicitudes/views.py b/cosiap_api/solicitudes/views.py index d7c164c..f1162c6 100644 --- a/cosiap_api/solicitudes/views.py +++ b/cosiap_api/solicitudes/views.py @@ -45,7 +45,9 @@ class SolicitudAPIView(DynamicTableAPIView): 'gte': [(datetime.now() - timedelta(days=5*30)).strftime('%Y-%m-%d')] } } - non_editable_fields = ["id"] + non_editable_fields = ["id","minuta__id","convenio__id","modalidad__id","modalidad__dynamic_form__id","timestamp","solicitante__id", + "solicitante__is_superuser","solicitante__is_staff","solicitante__municipio__id","solicitante__municipio__estado__id", + "solicitante__datos_bancarios__id","registro_formulario__id"] dynamic_form_exist = True diff --git a/cosiap_frontend/src/components/modalidades/EditarModalidad.jsx b/cosiap_frontend/src/components/modalidades/EditarModalidad.jsx index e60c474..016dc67 100644 --- a/cosiap_frontend/src/components/modalidades/EditarModalidad.jsx +++ b/cosiap_frontend/src/components/modalidades/EditarModalidad.jsx @@ -358,10 +358,10 @@ const EditModalidad = () => { {/* Secciones del formulario */} - {Object.values(sections).map(section => ( + {Object.values(sections).map((section,sectionIndex) => (
-

Sección {section.id}

+

Sección {sectionIndex + 1}

{ />
- {Object.values(section.elementos).map(element => ( + {Object.values(section.elementos).map((element, elementIndex) => (
-

Elemento {element.id}

+

Elemento {elementIndex + 1}