move assert where it is needed

This commit is contained in:
AlexejStukov 2016-07-21 08:55:30 +02:00 committed by GitHub
parent 6104f89925
commit 74c72f0126

View File

@ -97,9 +97,9 @@ class Binding(object):
self = cls()
self.instance = instance
# Check to see if we're covered
assert self.stream is not None
payload = self.serialize(instance, action)
if payload != {}:
assert self.stream is not None
message = WebsocketDemultiplexer.encode(self.stream, payload)
for group_name in self.group_names(instance, action):
group = Group(group_name)