mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-08 10:49:08 +00:00
[Fixture] 添加用户profile
This commit is contained in:
@@ -100,6 +100,16 @@ class User(AbstractUser):
|
||||
def public_key(self, public_key_raw):
|
||||
self._public_key = signer.sign(public_key_raw)
|
||||
|
||||
@property
|
||||
def public_key_hash(self):
|
||||
if self.public_key:
|
||||
import sshpubkeys
|
||||
try:
|
||||
return sshpubkeys.SSHKey(self.public_key).hash_md5()
|
||||
except TabError:
|
||||
pass
|
||||
return 'None'
|
||||
|
||||
@property
|
||||
def is_superuser(self):
|
||||
if self.role == 'Admin':
|
||||
|
Reference in New Issue
Block a user