mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 23:55:24 +00:00
accounts: add public key check
This commit is contained in:
parent
19489cb08e
commit
9f7ec62226
1 changed files with 3 additions and 0 deletions
|
@ -54,6 +54,9 @@ def profile(request):
|
||||||
if keypublic == key.keypublic:
|
if keypublic == key.keypublic:
|
||||||
msg = _("Public key already exist")
|
msg = _("Public key already exist")
|
||||||
error_messages.append(msg)
|
error_messages.append(msg)
|
||||||
|
if '\n' in keypublic or '\r' in keypublic:
|
||||||
|
msg = _("Invalid characters in public key")
|
||||||
|
error_messages.append(msg)
|
||||||
if not error_messages:
|
if not error_messages:
|
||||||
addkeypublic = UserSSHKey(user_id=request.user.id, keyname=keyname, keypublic=keypublic)
|
addkeypublic = UserSSHKey(user_id=request.user.id, keyname=keyname, keypublic=keypublic)
|
||||||
addkeypublic.save()
|
addkeypublic.save()
|
||||||
|
|
Loading…
Reference in a new issue