models.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:CodeGra.de 作者: CodeGra-de 项目源码 文件源码
def get_reset_token(self) -> str:
        """Get a token which a user can use to reset his password.

        .. note:: Don't forget to commit the database.

        :returns: A token that can be used in :py:meth:`User.reset_password` to
            reset the password of a user.
        """
        ts = URLSafeTimedSerializer(psef.app.config['SECRET_KEY'])
        self.reset_token = str(uuid.uuid4())
        return str(ts.dumps(self.username, salt=self.reset_token))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号