Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #877 from akatsoulas/1060782-events-api-traceback
Browse files Browse the repository at this point in the history
[fix bug 1060782] Raise 404 if there are errors in the API response.
  • Loading branch information
akatsoulas committed Nov 25, 2014
2 parents 9bef5e1 + 3a1a442 commit 92fe0e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions remo/base/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 92fe0e1

Please sign in to comment.