A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
websocket authentication
jonaswinklerba3c8308b369
diff --git a/src/paperless/consumers.py b/src/paperless/consumers.pyindex 21a0e3ede..b3d31b402 100644--- a/src/paperless/consumers.py+++ b/src/paperless/consumers.py@@ -1,14 +1,19 @@import jsonfrom asgiref.sync import async_to_sync+from channels.exceptions import DenyConnection, AcceptConnectionfrom channels.generic.websocket import WebsocketConsumerclass StatusConsumer(WebsocketConsumer):+def connect(self):- self.accept()- async_to_sync(self.channel_layer.group_add)(- 'status_updates', self.channel_name)+ if not self.scope['user'].is_authenticated:+ raise DenyConnection()+ else:+ async_to_sync(self.channel_layer.group_add)(+ 'status_updates', self.channel_name)+ raise AcceptConnection()def disconnect(self, close_code):async_to_sync(self.channel_layer.group_discard)(