From 3a1a442ca860910ad374291a1b0f085026a80ff6 Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Tue, 25 Nov 2014 15:23:26 +0200 Subject: [PATCH] [fix bug 1060782] Raise 404 if there are errors in the API response. --- remo/base/serializers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/remo/base/serializers.py b/remo/base/serializers.py index 772c7ba75..1e6e44b1c 100644 --- a/remo/base/serializers.py +++ b/remo/base/serializers.py @@ -3,6 +3,7 @@ import cStringIO from django.conf import settings +from django.http import Http404 from django.template import Context from django.template.loader import get_template from django.utils import timezone @@ -149,6 +150,9 @@ def to_ical(self, data, options=None): """Convert data to iCal.""" options = options or {} + if 'error' in data: + raise Http404 + if isinstance(data, dict) and 'objects' in data: events = [event.obj for event in data['objects']] else: