diff options
author | Dan McGee <dan@archlinux.org> | 2012-07-31 19:49:37 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-07-31 19:49:37 -0500 |
commit | f5d3c02eb14ea8b0018e17fa9be9c511ad7ebff9 (patch) | |
tree | cc3a031523e14207579d3d8e299d025f3216cc31 /packages | |
parent | 5f85a1240da14e57760c2ba6585ae943d7a1d8c2 (diff) |
Revert "Fall back to 410 Gone for package files view as well"release_2012-07-31
This reverts commit 9ab460c53a1ac4c79da6f05f2850ee21beedbab2.
This seemed like the right thing to do, but it doesn't really play well
with our more general dispatch framework we now do on the package
details pages. Just let it 404 like it always did, as these pages are
less essential. We can perhaps add a full dispatcher later if we really
feel the need.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/views/display.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/packages/views/display.py b/packages/views/display.py index 8adf3bee..b5cd643a 100644 --- a/packages/views/display.py +++ b/packages/views/display.py @@ -165,16 +165,8 @@ def group_details(request, arch, name): def files(request, name, repo, arch): - try: - pkg = Package.objects.get(pkgname=name, - repo__name__iexact=repo, arch__name=arch) - except Package.DoesNotExist: - # this may have been deleted recently, so follow the same logic as we - # do on the package details page if possible - ret = recently_removed_package(request, name, repo, arch) - if ret is not None: - return ret - raise Http404 + pkg = get_object_or_404(Package, + pkgname=name, repo__name__iexact=repo, arch__name=arch) # files are inserted in sorted order, so preserve that fileslist = PackageFile.objects.filter(pkg=pkg).order_by('id') dir_count = sum(1 for f in fileslist if f.is_directory) |