diff options
-rw-r--r-- | main/models.py | 2 | ||||
-rw-r--r-- | packages/views.py | 8 | ||||
-rw-r--r-- | templates/packages/details.html | 4 | ||||
-rw-r--r-- | todolists/views.py | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/main/models.py b/main/models.py index abbe050b..a022b8eb 100644 --- a/main/models.py +++ b/main/models.py @@ -249,7 +249,7 @@ class Package(models.Model): elif len(pkgs) == 1: deps.append({'dep': dep, 'pkg': pkgs[0]}) else: - tpkgs = pkgs.filter(repo__name='Testing') + tpkgs = pkgs.filter(repo__testing=True) if len(tpkgs) == 1: deps.append({'dep': dep, 'pkg': tpkgs[0]}) else: diff --git a/packages/views.py b/packages/views.py index 8a2b4ec3..6bd54a66 100644 --- a/packages/views.py +++ b/packages/views.py @@ -198,11 +198,11 @@ def unflag(request, pkgid): @permission_required('main.change_package') def signoffs(request): - packages = Package.objects.select_related('arch', 'repo', 'signoffs').filter(repo__name__endswith="Testing").order_by("pkgname") + packages = Package.objects.select_related('arch', 'repo', 'signoffs').filter(repo__testing=True).order_by("pkgname") package_list = [] - q_pkgname = Package.objects.filter(repo__name__endswith="Testing").values('pkgname').distinct().query - package_repos = Package.objects.values('pkgname', 'repo__name').exclude(repo__name__endswith="Testing").filter(pkgname__in=q_pkgname) + q_pkgname = Package.objects.filter(repo__testing=True).values('pkgname').distinct().query + package_repos = Package.objects.values('pkgname', 'repo__name').exclude(repo__testing=True).filter(pkgname__in=q_pkgname) pkgtorepo = dict() for pr in package_repos: pkgtorepo[pr['pkgname']] = pr['repo__name'] @@ -221,7 +221,7 @@ def signoff_package(request, arch, pkgname): pkg = get_object_or_404(Package, arch__name=arch, pkgname=pkgname, - repo__name="Testing") + repo__testing=True) signoff, created = Signoff.objects.get_or_create( pkg=pkg, diff --git a/templates/packages/details.html b/templates/packages/details.html index 496ca424..def07501 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -77,7 +77,7 @@ {% ifequal depend.pkg None %} <li>{{ depend.dep.depname }} (virtual)</li> {% else %} - <li><a href="{{ depend.pkg.get_absolute_url }}">{{ depend.dep.depname }}</a>{{ depend.dep.depvcmp }}{% ifequal depend.pkg.repo.name "Testing" %} (testing){% endifequal %}</li> + <li><a href="{{ depend.pkg.get_absolute_url }}">{{ depend.dep.depname }}</a>{{ depend.dep.depvcmp }}{% if depend.pkg.repo.testing %} (testing){% endif %}</li> {% endifequal %} {% endfor %} </ul> @@ -92,7 +92,7 @@ {% if rqdby %} <ul style="font-size:small;list-style:none"> {% for req in rqdby %} - <li><a href="{{req.get_absolute_url}}">{{ req.pkgname }}</a>{% ifequal req.repo.name "Testing" %} (testing){% endifequal %}</li> + <li><a href="{{req.get_absolute_url}}">{{ req.pkgname }}</a>{% if req.repo.testing %} (testing){% endif %}</li> {% endfor %} </ul> {% endif %} diff --git a/todolists/views.py b/todolists/views.py index f176e39c..411c0dbb 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -27,7 +27,7 @@ class TodoListForm(forms.Form): package_names = set(package_names) packages = Package.objects.filter( pkgname__in=package_names).exclude( - repo__name__endswith="Testing").order_by('arch') + repo__testing=True).order_by('arch') return packages |