mirror of https://github.com/jumpserver/jumpserver
fix id_dsa check error (#458)
* fix id_dsa check error
* fix 邮件修改密码 token错误
* fix 3c8aec9
add )
pull/485/merge
parent
b680a42425
commit
9b14244363
|
@ -180,15 +180,14 @@ def timesince(dt, since='', default="just now"):
|
||||||
|
|
||||||
|
|
||||||
def ssh_key_string_to_obj(text):
|
def ssh_key_string_to_obj(text):
|
||||||
key_f = StringIO(text)
|
|
||||||
key = None
|
key = None
|
||||||
try:
|
try:
|
||||||
key = paramiko.RSAKey.from_private_key(key_f)
|
key = paramiko.RSAKey.from_private_key( StringIO(text) )
|
||||||
except paramiko.SSHException:
|
except paramiko.SSHException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
key = paramiko.DSSKey.from_private_key(key_f)
|
key = paramiko.DSSKey.from_private_key( StringIO(text) )
|
||||||
except paramiko.SSHException:
|
except paramiko.SSHException:
|
||||||
pass
|
pass
|
||||||
return key
|
return key
|
||||||
|
|
|
@ -189,7 +189,7 @@ class User(AbstractUser):
|
||||||
return 'https://www.gravatar.com/avatar/c6812ab450230979465d7bf288eadce2a?s=120&d=identicon'
|
return 'https://www.gravatar.com/avatar/c6812ab450230979465d7bf288eadce2a?s=120&d=identicon'
|
||||||
|
|
||||||
def generate_reset_token(self):
|
def generate_reset_token(self):
|
||||||
return signer.sign_t({'reset': self.id, 'email': self.email}, expires_in=3600)
|
return signer.sign_t({'reset': self.id, 'email': self.email}, expires_in=3600).decode('utf-8')
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
return OrderedDict({
|
return OrderedDict({
|
||||||
|
|
Loading…
Reference in New Issue