2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-07-10 09:00:57 +00:00

Add flake8-logging linting (#5620)

* added flake8-logging to make logging more robust

* fixed LOG005 warnings

* fixed LOG008 warnings

* fixed LOG011 warnings

* fixed more LOG011 errors

* added ignores for intentional logger.error calls

* fixed even more LOG011 errors
This commit is contained in:
Matthias Mair
2023-09-28 06:53:22 +02:00
committed by GitHub
parent 08e7190832
commit 71c416bafd
45 changed files with 177 additions and 176 deletions
+3 -3
View File
@@ -93,7 +93,7 @@ def delete_old_notes_images():
# Remove any notes which point to non-existent image files
for note in NotesImage.objects.all():
if not os.path.exists(note.image.path):
logger.info(f"Deleting note {note.image.path} - image file does not exist")
logger.info("Deleting note %s - image file does not exist", note.image.path)
note.delete()
note_classes = getModelsWithMixin(InvenTreeNotesMixin)
@@ -112,7 +112,7 @@ def delete_old_notes_images():
break
if not found:
logger.info(f"Deleting note {img} - image file not linked to a note")
logger.info("Deleting note %s - image file not linked to a note", img)
note.delete()
# Finally, remove any images in the notes dir which are not linked to a note
@@ -136,5 +136,5 @@ def delete_old_notes_images():
break
if not found:
logger.info(f"Deleting note {image} - image file not linked to a note")
logger.info("Deleting note %s - image file not linked to a note", image)
os.remove(os.path.join(notes_dir, image))