change from throwing a Http404 exception, which I believe will try to render a static 404.html template - and ironically triggers a 500 server error. Just create a HttpResponse and set the status_code to 404.

This commit is contained in:
Chris Dodge
2013-02-05 16:26:07 -05:00
parent ecce3e5761
commit 3fa1fe0cd6
2 changed files with 6 additions and 1 deletions

View File

@@ -21,7 +21,9 @@ class StaticContentServer(object):
try:
content = contentstore().find(loc)
except NotFoundError:
raise Http404
response = HttpResponse()
response.status_code = 404
return response
# since we fetched it from DB, let's cache it going forward
set_cached_content(content)