From 28e417d7ef56cdd7ff8a7457bcc4adb0c8f423ad Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 11 Mar 2024 14:42:44 -0700 Subject: [PATCH] middleware: Show HTML exception message as extra detail in messages Tests: - Insert an exception in privileged setup() and uninstall() method and try to install/uninstall app and notice that error messages are shown in a simple format and extra details are provided, collapsed by default. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/middleware.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plinth/middleware.py b/plinth/middleware.py index 5a34798b8..a44a25072 100644 --- a/plinth/middleware.py +++ b/plinth/middleware.py @@ -32,7 +32,8 @@ def _collect_operations_results(request, app): operations = operation_module.manager.collect_results(app.app_id) for operation in operations: if operation.exception: - messages.error(request, operation.message) + views.messages_error(request, operation.message, + operation.exception) else: messages.success(request, operation.message)