Skip to content

Commit

Permalink
Fix debate edit consumer crash, closes #1689
Browse files Browse the repository at this point in the history
Relates to BACKEND-3WN
Relates to 6839ca5
  • Loading branch information
czlee committed Dec 6, 2020
1 parent aee8b02 commit 989aa88
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tabbycat/draw/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ def receive_teams(self, content):
debates = self.get_debates_or_panels(changes)
serialized = self.teams_serializer(debates, many=True,
context={'sides': self.tournament.sides})
del content['teams']
self.return_attributes(content, serialized)
content_to_return = content.copy()
del content_to_return['teams']
self.return_attributes(content_to_return, serialized)

def receive_sides_status(self, content):
changes = {int(c['id']): c for c in content['sides_confirmed']}
Expand All @@ -185,8 +186,9 @@ def receive_sides_status(self, content):

debates = self.get_debates_or_panels(changes)
serialized = self.sides_status_serializer(debates, many=True)
del content['sides_confirmed']
self.return_attributes(content, serialized)
content_to_return = content.copy()
del content_to_return['sides_confirmed']
self.return_attributes(content_to_return, serialized)

def receive_venues(self, content):
changes = {int(c['id']): c for c in content['venues']}
Expand All @@ -197,8 +199,9 @@ def receive_venues(self, content):

debates = self.get_debates_or_panels(changes)
serialized = self.venues_serializer(debates, many=True)
del content['venues']
self.return_attributes(content, serialized)
content_to_return = content.copy()
del content_to_return['venues']
self.return_attributes(content_to_return, serialized)


class EditDebateOrPanelWorkerMixin(SyncConsumer):
Expand Down

0 comments on commit 989aa88

Please sign in to comment.