From 3b5d55c428861dabd54fe8ac536d4b584297629e Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Tue, 26 Jan 2021 15:43:07 +0100 Subject: [PATCH] pycodestyle --- src/paperless/asgi.py | 6 +++--- src/paperless/consumers.py | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/paperless/asgi.py b/src/paperless/asgi.py index 45565c68a..2f6cc2d5f 100644 --- a/src/paperless/asgi.py +++ b/src/paperless/asgi.py @@ -8,10 +8,10 @@ from django.core.asgi import get_asgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "paperless.settings") django_asgi_app = get_asgi_application() -from channels.auth import AuthMiddlewareStack -from channels.routing import ProtocolTypeRouter, URLRouter +from channels.auth import AuthMiddlewareStack # NOQA: E402 +from channels.routing import ProtocolTypeRouter, URLRouter # NOQA: E402 -from paperless.urls import websocket_urlpatterns +from paperless.urls import websocket_urlpatterns # NOQA: E402 application = ProtocolTypeRouter({ "http": get_asgi_application(), diff --git a/src/paperless/consumers.py b/src/paperless/consumers.py index fbb7b72d0..21a0e3ede 100644 --- a/src/paperless/consumers.py +++ b/src/paperless/consumers.py @@ -7,10 +7,12 @@ from channels.generic.websocket import WebsocketConsumer class StatusConsumer(WebsocketConsumer): def connect(self): self.accept() - async_to_sync(self.channel_layer.group_add)('status_updates', self.channel_name) + async_to_sync(self.channel_layer.group_add)( + 'status_updates', self.channel_name) def disconnect(self, close_code): - async_to_sync(self.channel_layer.group_discard)('status_updates', self.channel_name) + async_to_sync(self.channel_layer.group_discard)( + 'status_updates', self.channel_name) def status_update(self, event): self.send(json.dumps(event['data']))