mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(util): fix account_url's base url generation
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
02a62532da
commit
c7751d5d63
1 changed files with 3 additions and 5 deletions
|
@ -103,11 +103,9 @@ def valid_ssh_pubkey(pk):
|
|||
|
||||
|
||||
@pass_context
|
||||
def account_url(context, user):
|
||||
request = context.get("request")
|
||||
base = f"{request.url.scheme}://{request.url.hostname}"
|
||||
if request.url.scheme == "http" and request.url.port != 80:
|
||||
base += f":{request.url.port}"
|
||||
def account_url(context: Dict[str, Any],
|
||||
user: "aurweb.models.user.User") -> str:
|
||||
base = aurweb.config.get("options", "aur_location")
|
||||
return f"{base}/account/{user.Username}"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue