Skip to content

Commit

Permalink
Only flag pacakges with same or lower pkgver
Browse files Browse the repository at this point in the history
Signed-off-by: Lars Rustand <rustand.lars@gmail.com>
  • Loading branch information
lrustand committed Aug 9, 2019
1 parent 566227f commit 75182de
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/views/flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ def find_same_pkgbase(pkg):
repo__testing=pkg.repo.testing,
repo__staging=pkg.repo.staging)

if "lib32-" in pkg.pkgname:
if 'lib32-' in pkg.pkgname:
# Find normal version of lib32 packages
non_lib32_pkg = get_object_or_404(Package.objects.normal(),
pkgname=pkg.pkgname.replace("lib32-",""))
pkgname=pkg.pkgname.replace('lib32-',''))
pkg_filter = pkg_filter | Q(pkgbase=non_lib32_pkg.pkgbase,
repo__testing=pkg.repo.testing,
repo__staging=pkg.repo.staging)
else:
# Find lib32 version of normal packages
try:
lib32_pkg = get_object_or_404(Package.objects.normal(),
pkgname="lib32-"+pkg.pkgbase)
pkgname='lib32-'+pkg.pkgbase)
pkg_filter = pkg_filter | Q(pkgbase=lib32_pkg.pkgbase,
repo__testing=pkg.repo.testing,
repo__staging=pkg.repo.staging)
Expand All @@ -85,7 +85,8 @@ def flag(request, name, repo, arch):
return render(request, 'packages/flagged.html', {'pkg': pkg})

pkgs = find_same_pkgbase(pkg).filter(
flag_date__isnull=True)
flag_date__isnull=True,
pkgver__lte=pkg.pkgver)

authenticated = request.user.is_authenticated

Expand Down

0 comments on commit 75182de

Please sign in to comment.