From 4040f1f5c9d9c1f66bdeb0f641cf7a62acc57903 Mon Sep 17 00:00:00 2001 From: kiblik <5609770+kiblik@users.noreply.github.com> Date: Thu, 2 May 2024 12:50:52 +0200 Subject: [PATCH] Ruff: add and fix G1 and G2 --- dojo/finding/views.py | 5 ++--- dojo/finding_group/views.py | 5 ++--- ruff.toml | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dojo/finding/views.py b/dojo/finding/views.py index f7624c996c..5bc75ef126 100644 --- a/dojo/finding/views.py +++ b/dojo/finding/views.py @@ -3386,9 +3386,8 @@ def push_to_jira(request, fid): ) return JsonResponse({"result": "OK"}) - except Exception as e: - logger.exception(e) - logger.error("Error pushing to JIRA: ", exc_info=True) + except Exception: + logger.exception("Error pushing to JIRA") messages.add_message( request, messages.ERROR, "Error pushing to JIRA", extra_tags="alert-danger" ) diff --git a/dojo/finding_group/views.py b/dojo/finding_group/views.py index b22c75d0e7..ce4a59e3be 100644 --- a/dojo/finding_group/views.py +++ b/dojo/finding_group/views.py @@ -194,9 +194,8 @@ def push_to_jira(request, fgid): extra_tags='alert-danger') return JsonResponse({'result': 'OK'}) - except Exception as e: - logger.exception(e) - logger.error('Error pushing to JIRA: ', exc_info=True) + except Exception: + logger.exception('Error pushing to JIRA') messages.add_message( request, messages.ERROR, diff --git a/ruff.toml b/ruff.toml index 3174bbcb9a..3d21f3551c 100644 --- a/ruff.toml +++ b/ruff.toml @@ -48,6 +48,7 @@ select = [ "EXE", "ICN", "LOG", + "G1", "G2", "INP", "SLOT", "PIE",