Password message (#2702)

* [Update] 密码信封

* [Update]  查看密码

* [Update] 支持查看密码

* [Update] 修改语言翻译

* [Update] 迁移ansible到2.8版本

* [Update] 修改auth book的可连接性

* [Update] 删除不使用的方法
This commit is contained in:
老广
2019-05-20 12:30:55 +08:00
committed by GitHub
parent 466b922ea0
commit 3855fecc69
21 changed files with 416 additions and 192 deletions

View File

@@ -147,6 +147,10 @@ class User(AbstractUser):
def otp_secret_key(self, item):
self._otp_secret_key = signer.sign(item)
def check_otp(self, code):
from ..utils import check_otp_code
return check_otp_code(self.otp_secret_key, code)
def get_absolute_url(self):
return reverse('users:user-detail', args=(self.id,))