Skip to content

Commit 48d4cf3

Browse files
committed
[tests:fix] Avoid repeated call to self.close()
1 parent 6aa8eec commit 48d4cf3

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

openwisp_controller/config/base/channels_consumer.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ class BaseDeviceConsumer(WebsocketConsumer):
1010
channel_layer_group = "config.device"
1111

1212
def _is_user_authenticated(self):
13-
try:
14-
assert self.scope["user"].is_authenticated is True
15-
except (KeyError, AssertionError):
16-
self.close()
17-
return False
18-
else:
19-
return True
13+
return self.scope["user"].is_authenticated is True
2014

2115
def is_user_authorized(self):
2216
user = self.scope["user"]

0 commit comments

Comments
 (0)