From 002a0af5ae077f1595ece4e7ebc421ebb66fe9b7 Mon Sep 17 00:00:00 2001 From: kiblik <5609770+kiblik@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:50:10 +0200 Subject: [PATCH] Ruff: add and fix G1 and G2 (#10088) --- 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 8373022d72..14de369728 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 30a62e2c0c..33976c5b20 100644 --- a/ruff.toml +++ b/ruff.toml @@ -49,6 +49,7 @@ select = [ "EXE", "ICN", "LOG", + "G1", "G2", "INP", "SLOT", "PIE",