Browse Source

Bypass temporal a IsOwnerOrStaff para que anden los reportes programados con usuarios no-staff

wilitp 3 years ago
parent
commit
792332aef2
1 changed files with 2 additions and 0 deletions
  1. 2 0
      app/api/views.py

+ 2 - 0
app/api/views.py

@@ -38,6 +38,8 @@ class SendReportNow(views.APIView):
             raise PermissionDenied(f"Su usuario no es dueño de este reporte({preport.user_id} != {user_id})")
         sent = preport.send_report_now()
         print("Se envio" if sent else "No se pudo enviar","el Programmed Report ID:", preport.id)
+        if not sent:
+            return Response("Error al comunicarse con clima", status.HTTP_500_INTERNAL_SERVER_ERROR)
         return Response("Ok", status.HTTP_200_OK)