diff --git a/cosiap_api/dynamic_forms/views.py b/cosiap_api/dynamic_forms/views.py index e6651a9bfaf21fb98eec3980e4843d804ed52107..a8196c717dbb60c4d43d96f4484bcda79c99fe1e 100644 --- a/cosiap_api/dynamic_forms/views.py +++ b/cosiap_api/dynamic_forms/views.py @@ -35,7 +35,7 @@ class BaseFormAPIView(BasePermissionAPIView): permission_classes_create = [IsAuthenticated, es_admin] permission_classes_delete = [IsAuthenticated, es_admin] - permission_classes_list = [IsAuthenticated, primer_login] + permission_classes_list = [IsAuthenticated] permission_classes_update = [IsAuthenticated, es_admin] def __init__(self): diff --git a/cosiap_api/dynamic_tables/DynamicTable.py b/cosiap_api/dynamic_tables/DynamicTable.py index ca3343271e977f4f29595ad12bcb189fa374fe5e..9cc18883adb361240e804a7465b922f354dad46f 100644 --- a/cosiap_api/dynamic_tables/DynamicTable.py +++ b/cosiap_api/dynamic_tables/DynamicTable.py @@ -158,7 +158,6 @@ class DynamicTable(serializers.ModelSerializer): (field.related_model is not None)): related_queryset = field.related_model.objects.all() queryset = queryset.prefetch_related(Prefetch(field.name, queryset=related_queryset)) - return list(queryset) except Exception as e: # Si hay algún fallo, regresamos una lista vacía diff --git a/cosiap_frontend/src/components/modalidades/Modalidad.jsx b/cosiap_frontend/src/components/modalidades/Modalidad.jsx index 9f631e6cb83b332fd8d5ff7f99bfa98ce4edde9e..f8ae535e699f5d944c8f404ff1aa99723be84630 100644 --- a/cosiap_frontend/src/components/modalidades/Modalidad.jsx +++ b/cosiap_frontend/src/components/modalidades/Modalidad.jsx @@ -248,8 +248,15 @@ const SolicitarModalidad = () => { showAlert(`Error: ${errorMessage}`, false); } } catch (error) { - const specificErrorMessage = error.response?.data?.messages?.error[0] || error.message || 'Error en la conexión'; - showAlert(`Error: ${specificErrorMessage}`, false); + console.log("Error", error.response.status) + console.log(error.response.status === 403) + if (error.response.status === 403){ + showAlert('Para registrar una solicitud, por favor complete sus datos en su perfil.', false) + } + else{ + const specificErrorMessage = error.response?.data?.messages?.error[0] || error.message || 'Error en la conexión'; + showAlert(`Error: ${specificErrorMessage}`, false) + } } };