mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-09-03 16:35:06 +00:00
Chore: enable flake8-bandit S102/S110/S112 ruff rules
3 S110 (try-except-pass) hits, all fixed by adding a log call in the except block rather than silently swallowing the exception, matching this codebase's existing %s lazy-formatting logging convention. Behavior is unchanged (still no re-raise) in all three spots.
This commit is contained in:
@@ -970,7 +970,7 @@ class ConsumerPlugin(
|
||||
try:
|
||||
copy_basic_file_stats(source, target)
|
||||
except Exception: # pragma: no cover
|
||||
pass
|
||||
self.log.debug("Unable to copy file stats from %s to %s", source, target)
|
||||
|
||||
|
||||
class ConsumerPreflightPlugin(
|
||||
|
||||
@@ -637,7 +637,7 @@ def update_filename_and_move_files(
|
||||
# so this is not the end of the world.
|
||||
# B: if moving the original file failed, nothing has changed
|
||||
# anyway.
|
||||
pass
|
||||
logger.exception("Error reverting document changes")
|
||||
|
||||
# restore old values on the instance
|
||||
instance.filename = old_filename
|
||||
|
||||
@@ -1449,7 +1449,7 @@ class DocumentViewSet(
|
||||
try:
|
||||
lang = detect(doc.content)
|
||||
except Exception:
|
||||
pass
|
||||
logger.debug("Unable to detect language for document %s", doc.pk)
|
||||
meta["lang"] = lang
|
||||
|
||||
return Response(meta)
|
||||
|
||||
Reference in New Issue
Block a user