mirror of
https://github.com/ansible/awx.git
synced 2026-03-02 01:08:48 -03:30
Make current_groups a set to easily avoid duplicates, update asgi-amqp requirement
This commit is contained in:
@@ -63,7 +63,7 @@ def ws_receive(message):
|
|||||||
if 'groups' in data:
|
if 'groups' in data:
|
||||||
discard_groups(message)
|
discard_groups(message)
|
||||||
groups = data['groups']
|
groups = data['groups']
|
||||||
current_groups = message.channel_session.pop('groups') if 'groups' in message.channel_session else []
|
current_groups = set(message.channel_session.pop('groups') if 'groups' in message.channel_session else [])
|
||||||
for group_name,v in groups.items():
|
for group_name,v in groups.items():
|
||||||
if type(v) is list:
|
if type(v) is list:
|
||||||
for oid in v:
|
for oid in v:
|
||||||
@@ -74,12 +74,12 @@ def ws_receive(message):
|
|||||||
if not user_access.get_queryset().filter(pk=oid).exists():
|
if not user_access.get_queryset().filter(pk=oid).exists():
|
||||||
message.reply_channel.send({"text": json.dumps({"error": "access denied to channel {0} for resource id {1}".format(group_name, oid)})})
|
message.reply_channel.send({"text": json.dumps({"error": "access denied to channel {0} for resource id {1}".format(group_name, oid)})})
|
||||||
continue
|
continue
|
||||||
current_groups.append(name)
|
current_groups.add(name)
|
||||||
Group(name).add(message.reply_channel)
|
Group(name).add(message.reply_channel)
|
||||||
else:
|
else:
|
||||||
current_groups.append(group_name)
|
current_groups.add(group_name)
|
||||||
Group(group_name).add(message.reply_channel)
|
Group(group_name).add(message.reply_channel)
|
||||||
message.channel_session['groups'] = current_groups
|
message.channel_session['groups'] = list(current_groups)
|
||||||
|
|
||||||
|
|
||||||
def emit_channel_notification(group, payload):
|
def emit_channel_notification(group, payload):
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
-e git+https://github.com/ansible/dm.xmlsec.binding.git@master#egg=dm.xmlsec.binding
|
-e git+https://github.com/ansible/dm.xmlsec.binding.git@master#egg=dm.xmlsec.binding
|
||||||
-e git+https://github.com/chrismeyersfsu/pyrax@tower#egg=pyrax
|
-e git+https://github.com/chrismeyersfsu/pyrax@tower#egg=pyrax
|
||||||
apache-libcloud==1.3.0
|
apache-libcloud==1.3.0
|
||||||
asgi-amqp==0.3.1
|
asgi-amqp==0.4.0
|
||||||
azure==2.0.0rc6
|
azure==2.0.0rc6
|
||||||
backports.ssl-match-hostname==3.5.0.1
|
backports.ssl-match-hostname==3.5.0.1
|
||||||
boto==2.45.0
|
boto==2.45.0
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ amqp==1.4.9 # via kombu
|
|||||||
anyjson==0.3.3 # via kombu
|
anyjson==0.3.3 # via kombu
|
||||||
apache-libcloud==1.3.0
|
apache-libcloud==1.3.0
|
||||||
appdirs==1.4.0 # via os-client-config, python-ironicclient, rply
|
appdirs==1.4.0 # via os-client-config, python-ironicclient, rply
|
||||||
asgi-amqp==0.3.1
|
asgi-amqp==0.4.0
|
||||||
asgiref==1.0.0 # via asgi-amqp, channels, daphne
|
asgiref==1.0.0 # via asgi-amqp, channels, daphne
|
||||||
attrs==16.3.0 # via service-identity
|
attrs==16.3.0 # via service-identity
|
||||||
autobahn==0.17.0 # via daphne
|
autobahn==0.17.0 # via daphne
|
||||||
|
|||||||
Reference in New Issue
Block a user