summaryrefslogtreecommitdiff
path: root/packages/views.py
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2008-02-26 18:36:20 -0800
committereliott <eliott@cactuswax.net>2008-02-26 18:36:20 -0800
commit7e2d0f2f0cd8f176cf82c02d704ad4fe25a07b3b (patch)
tree5800fc3acf99692038bf9b3aad4465daaf9783d7 /packages/views.py
parent2b1ee7cf61f84c5e0eb2611d4e51e3de8099914c (diff)
Fix for testing cvs linksrelease_2008022601
Diffstat (limited to 'packages/views.py')
-rw-r--r--packages/views.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/views.py b/packages/views.py
index 604a7dcb..2b8f8b22 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -8,6 +8,8 @@ from django.contrib.auth.models import User
from archweb_dev.lib.utils import validate, render_response
from datetime import datetime
from archweb_dev.packages.models import Package, PackageFile, Repo, Category
+from django.core.exceptions import ObjectDoesNotExist
+
def update(request):
if request.POST.has_key('adopt'):
@@ -43,7 +45,18 @@ def details(request, pkgid=0, name='', repo=''):
pkgid = p[0].id
pkg = get_object_or_404(Package, id=pkgid)
- return render_response(request, 'packages/details.html', {'pkg':pkg})
+ origin_repo = None
+ if pkg.repo.name == 'Testing':
+ try:
+ origin_repo = Package.objects.filter(
+ pkgname__exact = pkg.pkgname).exclude(
+ repo__name__exact = pkg.repo.name).get().repo.name
+ except ObjectDoesNotExist:
+ origin_repo = None
+ return render_response(
+ request,
+ 'packages/details.html',
+ {'pkg': pkg, 'origin_repo': origin_repo})
def search(request, query=''):
if request.GET.has_key('q'):