Skip to content

Commit 184367b

Browse files
committed
Fix a property collision in django connectioncontext
1 parent faea9cf commit 184367b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: graphql_ws/django/consumers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async def connect(self):
3434

3535
async def disconnect(self, code):
3636
if self.connection_context:
37-
self.connection_context.closed = True
37+
self.connection_context.socket_closed = True
3838
await subscription_server.on_close(self.connection_context)
3939

4040
async def receive_json(self, content):

Diff for: graphql_ws/django/subscriptions.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
class ChannelsConnectionContext(BaseConnectionContext):
1313
def __init__(self, *args, **kwargs):
1414
super(ChannelsConnectionContext, self).__init__(*args, **kwargs)
15-
self.closed = False
15+
self.socket_closed = False
1616

1717
async def send(self, data):
1818
if self.closed:
1919
return
2020
await self.ws.send_json(data)
2121

22+
@property
23+
def closed(self):
24+
return self.socket_closed
25+
2226
async def close(self, code):
2327
await self.ws.close(code=code)
2428

0 commit comments

Comments
 (0)