mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: same ssh key entered multiple times
Users might accidentally past their ssh key multiple times when they try to register or edit their account. Convert our of list of keys to a set, removing any double keys. Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
parent
225ce23761
commit
5ccfa7c0fd
2 changed files with 27 additions and 2 deletions
|
@ -192,9 +192,9 @@ def parse_ssh_key(string: str) -> Tuple[str, str]:
|
|||
return prefix, key
|
||||
|
||||
|
||||
def parse_ssh_keys(string: str) -> list[Tuple[str, str]]:
|
||||
def parse_ssh_keys(string: str) -> set[Tuple[str, str]]:
|
||||
"""Parse a list of SSH public keys."""
|
||||
return [parse_ssh_key(e) for e in string.strip().splitlines(True) if e.strip()]
|
||||
return set([parse_ssh_key(e) for e in string.strip().splitlines(True) if e.strip()])
|
||||
|
||||
|
||||
def shell_exec(cmdline: str, cwd: str) -> Tuple[int, str, str]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue