Skip to content

Commit

Permalink
Ruff: add and fix G1 and G2 (#10088)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik authored Jul 8, 2024
1 parent 63cbaab commit 002a0af
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions dojo/finding/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
5 changes: 2 additions & 3 deletions dojo/finding_group/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ select = [
"EXE",
"ICN",
"LOG",
"G1", "G2",
"INP",
"SLOT",
"PIE",
Expand Down

0 comments on commit 002a0af

Please sign in to comment.