Fix error in consumer when camp matching query does not exist.
This commit is contained in:
parent
af94eba144
commit
034543595a
|
@ -12,6 +12,7 @@ class ScheduleConsumer(JsonWebsocketConsumer):
|
|||
|
||||
def connect(self, message, **kwargs):
|
||||
camp_slug = message.http_session['campslug']
|
||||
try:
|
||||
camp = Camp.objects.get(slug=camp_slug)
|
||||
days = list(map(
|
||||
lambda day:
|
||||
|
@ -29,6 +30,8 @@ class ScheduleConsumer(JsonWebsocketConsumer):
|
|||
"days": days,
|
||||
"action": "init"
|
||||
})
|
||||
except Camp.DoesNotExist:
|
||||
pass
|
||||
|
||||
def raw_receive(self, message, **kwargs):
|
||||
content = self.decode_json(message['text'])
|
||||
|
|
Loading…
Reference in a new issue