mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
pycodestyle
This commit is contained in:
parent
9993381cda
commit
80b3fa75a5
@ -17,7 +17,10 @@ class LoggingMixin:
|
|||||||
if self.logging_name:
|
if self.logging_name:
|
||||||
logger = logging.getLogger(self.logging_name)
|
logger = logging.getLogger(self.logging_name)
|
||||||
else:
|
else:
|
||||||
name = ".".join([self.__class__.__module__, self.__class__.__name__])
|
name = ".".join([
|
||||||
|
self.__class__.__module__,
|
||||||
|
self.__class__.__name__
|
||||||
|
])
|
||||||
logger = logging.getLogger(name)
|
logger = logging.getLogger(name)
|
||||||
|
|
||||||
getattr(logger, level)(message, extra={
|
getattr(logger, level)(message, extra={
|
||||||
|
@ -312,7 +312,7 @@ class LogViewSet(ViewSet):
|
|||||||
log_files = ["paperless", "mail"]
|
log_files = ["paperless", "mail"]
|
||||||
|
|
||||||
def retrieve(self, request, pk=None, *args, **kwargs):
|
def retrieve(self, request, pk=None, *args, **kwargs):
|
||||||
if not pk in self.log_files:
|
if pk not in self.log_files:
|
||||||
raise Http404()
|
raise Http404()
|
||||||
|
|
||||||
filename = os.path.join(settings.LOGGING_DIR, f"{pk}.log")
|
filename = os.path.join(settings.LOGGING_DIR, f"{pk}.log")
|
||||||
@ -321,7 +321,7 @@ class LogViewSet(ViewSet):
|
|||||||
raise Http404()
|
raise Http404()
|
||||||
|
|
||||||
with open(filename, "r") as f:
|
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)
|
return Response(lines)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user