Explorar o código

feat: improve error response formatting for LDAP group errors

Manuel hai 2 meses
pai
achega
b57fba065a
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      routes/admin/ldap_config.py

+ 7 - 1
routes/admin/ldap_config.py

@@ -69,7 +69,13 @@ def register_routes(bp):
             return jsonify({"status": "error", "message": str(exc), "groups": []}), 400
         except Exception as exc:
             logger.exception(f"Unexpected LDAP group error: {exc}")
-            return jsonify({"status": "error", "message": _("Error interno en grupos LDAP."), "groups": []}), 500
+            return jsonify(
+                {
+                    "status": "error",
+                    "message": _("Error interno en grupos LDAP."),
+                    "groups": [],
+                }
+            ), 500
 
     # ------------------------------------------------------------------
     # Test connection