mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(fastapi): remove info-specific fields from search results
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
f26cd1e994
commit
451eec0c28
1 changed files with 15 additions and 6 deletions
|
@ -162,7 +162,20 @@ class RPC:
|
|||
"Popularity": pop,
|
||||
"OutOfDate": package.PackageBase.OutOfDateTS,
|
||||
"FirstSubmitted": package.PackageBase.SubmittedTS,
|
||||
"LastModified": package.PackageBase.ModifiedTS,
|
||||
"LastModified": package.PackageBase.ModifiedTS
|
||||
})
|
||||
|
||||
if package.PackageBase.Maintainer is not None:
|
||||
# We do have a maintainer: set the Maintainer key.
|
||||
data["Maintainer"] = package.PackageBase.Maintainer.Username
|
||||
|
||||
return data
|
||||
|
||||
def _get_info_json_data(self, package: models.Package):
|
||||
data = self._get_json_data(package)
|
||||
|
||||
# Add licenses and keywords to info output.
|
||||
data.update({
|
||||
"License": [
|
||||
lic.License.Name for lic in package.package_licenses
|
||||
],
|
||||
|
@ -171,10 +184,6 @@ class RPC:
|
|||
]
|
||||
})
|
||||
|
||||
if package.PackageBase.Maintainer is not None:
|
||||
# We do have a maintainer: set the Maintainer key.
|
||||
data["Maintainer"] = package.PackageBase.Maintainer.Username
|
||||
|
||||
self._update_json_depends(package, data)
|
||||
self._update_json_relations(package, data)
|
||||
return data
|
||||
|
@ -184,7 +193,7 @@ class RPC:
|
|||
args = set(args)
|
||||
packages = db.query(models.Package).filter(
|
||||
models.Package.Name.in_(args))
|
||||
return [self._get_json_data(pkg) for pkg in packages]
|
||||
return [self._get_info_json_data(pkg) for pkg in packages]
|
||||
|
||||
def _handle_search_type(self, by: str = defaults.RPC_SEARCH_BY,
|
||||
args: List[str] = []):
|
||||
|
|
Loading…
Add table
Reference in a new issue