Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
aurweb
Commits
89f081a8
Verified
Commit
89f081a8
authored
Mar 08, 2022
by
Kevin Morris
Browse files
Merge branch 'master' into live
parents
87b94ce0
0afa07ed
Pipeline
#16423
passed with stages
in 4 minutes and 15 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
aurweb/config.py
View file @
89f081a8
...
...
@@ -6,7 +6,7 @@ from typing import Any
# Publicly visible version of aurweb. This is used to display
# aurweb versioning in the footer and must be maintained.
# Todo: Make this dynamic/automated.
AURWEB_VERSION
=
"v6.0.2
3
"
AURWEB_VERSION
=
"v6.0.2
4
"
_parser
=
None
...
...
aurweb/rpc.py
View file @
89f081a8
...
...
@@ -332,7 +332,7 @@ class RPC:
models
.
PackageBase
).
filter
(
and_
(
models
.
PackageBase
.
PackagerUID
.
isnot
(
None
),
models
.
Package
.
Name
.
like
(
f
"
%
{
arg
}
%"
))
models
.
Package
.
Name
.
like
(
f
"
{
arg
}
%"
))
).
order_by
(
models
.
Package
.
Name
.
asc
()).
limit
(
20
)
return
[
pkg
.
Name
for
pkg
in
packages
]
...
...
@@ -341,9 +341,10 @@ class RPC:
if
not
args
:
return
[]
arg
=
args
[
0
]
packages
=
db
.
query
(
models
.
PackageBase
.
Name
).
filter
(
and_
(
models
.
PackageBase
.
PackagerUID
.
isnot
(
None
),
models
.
PackageBase
.
Name
.
like
(
f
"
%
{
arg
s
[
0
]
}
%"
))
models
.
PackageBase
.
Name
.
like
(
f
"
{
arg
}
%"
))
).
order_by
(
models
.
PackageBase
.
Name
.
asc
()).
limit
(
20
)
return
[
pkg
.
Name
for
pkg
in
packages
]
...
...
pyproject.toml
View file @
89f081a8
...
...
@@ -8,7 +8,7 @@
#
[tool.poetry]
name
=
"aurweb"
version
=
"v6.0.2
3
"
version
=
"v6.0.2
4
"
license
=
"GPL-2.0-only"
description
=
"Source code for the Arch User Repository's website"
homepage
=
"https://aur.archlinux.org"
...
...
test/test_rpc.py
View file @
89f081a8
...
...
@@ -551,6 +551,14 @@ def test_rpc_suggest_pkgbase(client: TestClient, packages: List[Package]):
data
=
response
.
json
()
assert
data
==
[]
# Test that suggestions are only given based on the beginning
# of the keyword string.
params
[
"arg"
]
=
"ther-pkg"
with
client
as
request
:
response
=
request
.
get
(
"/rpc"
,
params
=
params
)
data
=
response
.
json
()
assert
data
==
[]
def
test_rpc_suggest
(
client
:
TestClient
,
packages
:
List
[
Package
]):
params
=
{
"v"
:
5
,
"type"
:
"suggest"
,
"arg"
:
"other"
}
...
...
@@ -573,6 +581,14 @@ def test_rpc_suggest(client: TestClient, packages: List[Package]):
data
=
response
.
json
()
assert
data
==
[]
# Test that suggestions are only given based on the beginning
# of the keyword string.
params
[
"arg"
]
=
"ther-pkg"
with
client
as
request
:
response
=
request
.
get
(
"/rpc"
,
params
=
params
)
data
=
response
.
json
()
assert
data
==
[]
def
mock_config_getint
(
section
:
str
,
key
:
str
):
if
key
==
"request_limit"
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment