Skip to content

Commit 75182de

Browse files
committed
Only flag pacakges with same or lower pkgver
Signed-off-by: Lars Rustand <[email protected]>
1 parent 566227f commit 75182de

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/views/flag.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ def find_same_pkgbase(pkg):
5353
repo__testing=pkg.repo.testing,
5454
repo__staging=pkg.repo.staging)
5555

56-
if "lib32-" in pkg.pkgname:
56+
if 'lib32-' in pkg.pkgname:
5757
# Find normal version of lib32 packages
5858
non_lib32_pkg = get_object_or_404(Package.objects.normal(),
59-
pkgname=pkg.pkgname.replace("lib32-",""))
59+
pkgname=pkg.pkgname.replace('lib32-',''))
6060
pkg_filter = pkg_filter | Q(pkgbase=non_lib32_pkg.pkgbase,
6161
repo__testing=pkg.repo.testing,
6262
repo__staging=pkg.repo.staging)
6363
else:
6464
# Find lib32 version of normal packages
6565
try:
6666
lib32_pkg = get_object_or_404(Package.objects.normal(),
67-
pkgname="lib32-"+pkg.pkgbase)
67+
pkgname='lib32-'+pkg.pkgbase)
6868
pkg_filter = pkg_filter | Q(pkgbase=lib32_pkg.pkgbase,
6969
repo__testing=pkg.repo.testing,
7070
repo__staging=pkg.repo.staging)
@@ -85,7 +85,8 @@ def flag(request, name, repo, arch):
8585
return render(request, 'packages/flagged.html', {'pkg': pkg})
8686

8787
pkgs = find_same_pkgbase(pkg).filter(
88-
flag_date__isnull=True)
88+
flag_date__isnull=True,
89+
pkgver__lte=pkg.pkgver)
8990

9091
authenticated = request.user.is_authenticated
9192

0 commit comments

Comments
 (0)