mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Fixed #482: Group_names not updated right in base classes.
This commit is contained in:
parent
37da462411
commit
05b5fa5216
|
@ -142,7 +142,7 @@ class Binding(object):
|
|||
if action == CREATE:
|
||||
group_names = set()
|
||||
else:
|
||||
group_names = set(cls.group_names(instance, action))
|
||||
group_names = set(cls.group_names(instance))
|
||||
|
||||
if not hasattr(instance, '_binding_group_names'):
|
||||
instance._binding_group_names = {}
|
||||
|
@ -157,7 +157,7 @@ class Binding(object):
|
|||
if action == DELETE:
|
||||
new_group_names = set()
|
||||
else:
|
||||
new_group_names = set(cls.group_names(instance, action))
|
||||
new_group_names = set(cls.group_names(instance))
|
||||
|
||||
# if post delete, new_group_names should be []
|
||||
self = cls()
|
||||
|
@ -186,7 +186,7 @@ class Binding(object):
|
|||
group.send(message)
|
||||
|
||||
@classmethod
|
||||
def group_names(cls, instance, action):
|
||||
def group_names(cls, instance):
|
||||
"""
|
||||
Returns the iterable of group names to send the object to based on the
|
||||
instance and action performed on it.
|
||||
|
|
|
@ -21,7 +21,7 @@ class TestsBinding(ChannelTestCase):
|
|||
fields = ['username', 'email', 'password', 'last_name']
|
||||
|
||||
@classmethod
|
||||
def group_names(cls, instance, action):
|
||||
def group_names(cls, instance):
|
||||
return ["users"]
|
||||
|
||||
def has_permission(self, user, action, pk):
|
||||
|
@ -62,7 +62,7 @@ class TestsBinding(ChannelTestCase):
|
|||
exclude = ['first_name', 'last_name']
|
||||
|
||||
@classmethod
|
||||
def group_names(cls, instance, action):
|
||||
def group_names(cls, instance):
|
||||
return ["users_exclude"]
|
||||
|
||||
def has_permission(self, user, action, pk):
|
||||
|
@ -105,7 +105,7 @@ class TestsBinding(ChannelTestCase):
|
|||
stream = 'test'
|
||||
|
||||
@classmethod
|
||||
def group_names(cls, instance, action):
|
||||
def group_names(cls, instance):
|
||||
return ["users_omit"]
|
||||
|
||||
def has_permission(self, user, action, pk):
|
||||
|
@ -119,7 +119,7 @@ class TestsBinding(ChannelTestCase):
|
|||
fields = ['__all__']
|
||||
|
||||
@classmethod
|
||||
def group_names(cls, instance, action):
|
||||
def group_names(cls, instance):
|
||||
return ["users2"]
|
||||
|
||||
def has_permission(self, user, action, pk):
|
||||
|
@ -164,7 +164,7 @@ class TestsBinding(ChannelTestCase):
|
|||
fields = ['username']
|
||||
|
||||
@classmethod
|
||||
def group_names(cls, instance, action):
|
||||
def group_names(cls, instance):
|
||||
return ["users3"]
|
||||
|
||||
def has_permission(self, user, action, pk):
|
||||
|
@ -203,7 +203,7 @@ class TestsBinding(ChannelTestCase):
|
|||
fields = ['username', 'email', 'password', 'last_name']
|
||||
|
||||
@classmethod
|
||||
def group_names(cls, instance, action):
|
||||
def group_names(cls, instance):
|
||||
return ['users_outbound']
|
||||
|
||||
def has_permission(self, user, action, pk):
|
||||
|
@ -243,7 +243,7 @@ class TestsBinding(ChannelTestCase):
|
|||
fields = ['username', ]
|
||||
|
||||
@classmethod
|
||||
def group_names(cls, instance, action):
|
||||
def group_names(cls, instance):
|
||||
return ['users_outbound']
|
||||
|
||||
def has_permission(self, user, action, pk):
|
||||
|
@ -289,7 +289,7 @@ class TestsBinding(ChannelTestCase):
|
|||
fields = ['username', ]
|
||||
|
||||
@classmethod
|
||||
def group_names(cls, instance, action):
|
||||
def group_names(cls, instance):
|
||||
return ['users_outbound']
|
||||
|
||||
def has_permission(self, user, action, pk):
|
||||
|
|
Loading…
Reference in New Issue
Block a user