Skip to content

Commit

Permalink
Default code to 1005
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb15 committed Aug 19, 2022
1 parent 3832481 commit 54e5591
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions channels/generic/websocket.py
Expand Up @@ -102,7 +102,7 @@ def websocket_disconnect(self, message):
raise InvalidChannelLayerError(
"BACKEND is unconfigured or doesn't support groups"
)
self.disconnect(message["code"])
self.disconnect(message.get("code", 1005))
raise StopConsumer()

def disconnect(self, code):
Expand Down Expand Up @@ -235,7 +235,7 @@ async def websocket_disconnect(self, message):
raise InvalidChannelLayerError(
"BACKEND is unconfigured or doesn't support groups"
)
await self.disconnect(message["code"])
await self.disconnect(message.get("code", 1005))
raise StopConsumer()

async def disconnect(self, code):
Expand Down

0 comments on commit 54e5591

Please sign in to comment.