diff options
author | 2012-11-23 10:25:30 +0100 | |
---|---|---|
committer | 2012-11-23 10:25:30 +0100 | |
commit | e8670bc85358f60af56058dff6bb46408c245ba4 (patch) | |
tree | f44c4ea294337898a44c1f8a48ad7e9983f1d962 /euscanwww | |
parent | Update TODO (diff) | |
download | euscan-e8670bc85358f60af56058dff6bb46408c245ba4.tar.gz euscan-e8670bc85358f60af56058dff6bb46408c245ba4.tar.bz2 euscan-e8670bc85358f60af56058dff6bb46408c245ba4.zip |
Return HttpResponseNotFound(), got 20 exceptions emails this morning :D
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Diffstat (limited to 'euscanwww')
-rw-r--r-- | euscanwww/djeuscan/views.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/euscanwww/djeuscan/views.py b/euscanwww/djeuscan/views.py index 9fb8879..da3bcac 100644 --- a/euscanwww/djeuscan/views.py +++ b/euscanwww/djeuscan/views.py @@ -234,8 +234,13 @@ def package_version_metadata(request, category, package, version_tag): revision=rev, overlay=over) content = "" if version.metadata_path: - with open(version.metadata_path) as meta_file: - content = meta_file.read() + 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: - with open(version.ebuild_path) as ebuild_file: - content = ebuild_file.read() + 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") |