From 80b3fa75a540ce6507334fe2224babe1b6b99400 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Sat, 6 Feb 2021 17:21:32 +0100 Subject: [PATCH] pycodestyle --- src/documents/loggers.py | 5 ++++- src/documents/views.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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)