Fix #179.
This commit is contained in:
parent
969e737d3e
commit
5e6ff4e76f
|
@ -83,13 +83,19 @@ class ScheduleConsumer(JsonWebsocketConsumer):
|
||||||
)
|
)
|
||||||
|
|
||||||
if action == 'unfavorite':
|
if action == 'unfavorite':
|
||||||
|
try:
|
||||||
event_instance_id = content.get('event_instance_id')
|
event_instance_id = content.get('event_instance_id')
|
||||||
event_instance = EventInstance.objects.get(id=event_instance_id)
|
event_instance = EventInstance.objects.get(
|
||||||
|
id=event_instance_id
|
||||||
|
)
|
||||||
favorite = Favorite.objects.get(
|
favorite = Favorite.objects.get(
|
||||||
event_instance=event_instance,
|
event_instance=event_instance,
|
||||||
user=user
|
user=user
|
||||||
)
|
)
|
||||||
favorite.delete()
|
favorite.delete()
|
||||||
|
except EventInstance.DoesNotExist:
|
||||||
|
# We don't want to do anything.
|
||||||
|
return
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
self.send_json(data)
|
self.send_json(data)
|
||||||
|
|
Loading…
Reference in a new issue