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
313f2886d7
commit
3b5d55c428
@ -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(),
|
||||
|
@ -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']))
|
||||
|
Loading…
x
Reference in New Issue
Block a user