Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
idiomatic django
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaker Islam committed Apr 14, 2014
1 parent 4367349 commit 274cdd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bulbs/api/views.py
Expand Up @@ -2,6 +2,7 @@

from django.conf import settings
from django.contrib.auth import get_user_model
from django.http import Http404
from django.template.defaultfilters import slugify
from django.utils import timezone
from django.utils.dateparse import parse_datetime
Expand Down Expand Up @@ -52,7 +53,7 @@ def get_serializer_class(self):
try:
klass = Content.get_doctypes()[self.request.REQUEST["doctype"]]
except KeyError:
return Response(status=status.HTTP_404_NOT_FOUND)
raise Http404

if hasattr(klass, "get_serializer_class"):
return klass.get_serializer_class()
Expand Down

0 comments on commit 274cdd1

Please sign in to comment.