mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(python): fix package_link check
This was failing when it matched more than one record. This fixes that issue by using an EXISTS query. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
8b350066c1
commit
a9a0adaead
1 changed files with 2 additions and 2 deletions
|
@ -67,8 +67,8 @@ def pkgname_link(pkgname: str) -> str:
|
|||
def package_link(package: models.Package) -> str:
|
||||
base = "/".join([OFFICIAL_BASE, "packages"])
|
||||
official = db.query(models.OfficialProvider).filter(
|
||||
models.OfficialProvider.Name == package.Name)
|
||||
if official.scalar():
|
||||
models.OfficialProvider.Name == package.Name).exists()
|
||||
if db.query(official).scalar():
|
||||
return f"{base}/?q={package.Name}"
|
||||
return f"/packages/{package.Name}"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue