diff --git a/src/documents/loggers.py b/src/documents/loggers.py index 4b0f03552..90f6770e0 100644 --- a/src/documents/loggers.py +++ b/src/documents/loggers.py @@ -17,7 +17,10 @@ class LoggingMixin: if self.logging_name: logger = logging.getLogger(self.logging_name) else: - name = ".".join([self.__class__.__module__, self.__class__.__name__]) + name = ".".join([ + self.__class__.__module__, + self.__class__.__name__ + ]) logger = logging.getLogger(name) getattr(logger, level)(message, extra={ diff --git a/src/documents/views.py b/src/documents/views.py index 2443ae342..5ab4ca9df 100755 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -312,7 +312,7 @@ class LogViewSet(ViewSet): log_files = ["paperless", "mail"] def retrieve(self, request, pk=None, *args, **kwargs): - if not pk in self.log_files: + if pk not in self.log_files: raise Http404() filename = os.path.join(settings.LOGGING_DIR, f"{pk}.log") @@ -321,7 +321,7 @@ class LogViewSet(ViewSet): raise Http404() with open(filename, "r") as f: - lines = [l.rstrip() for l in f.readlines()] + lines = [line.rstrip() for line in f.readlines()] return Response(lines)