Return HttpResponseNotFound(), got 20 exceptions emails this morning :D

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
Corentin Chary 2012-11-23 10:25:30 +01:00
parent c135c35670
commit e8670bc853

View File

@ -234,8 +234,13 @@ def package_version_metadata(request, category, package, version_tag):
revision=rev, overlay=over)
content = ""
if version.metadata_path:
try:
with open(version.metadata_path) as meta_file:
content = meta_file.read()
except IOError:
return HttpResponseNotFound()
else:
return HttpResponseNotFound()
return HttpResponse(content, content_type="text/plain")
@ -248,8 +253,13 @@ def package_version_ebuild(request, category, package, version_tag):
version = get_object_or_404(Version, package=package, version=ver,
revision=rev, overlay=over)
if version.ebuild_path:
try:
with open(version.ebuild_path) as ebuild_file:
content = ebuild_file.read()
except IOError:
return HttpResponseNotFound()
else:
return HttpResponseNotFound()
return HttpResponse(content, content_type="text/plain")