From 0a6c6a2afd79a1c66ba88ffd59c99e1deb3a134e Mon Sep 17 00:00:00 2001 From: Trent Palmer Date: Sun, 9 Feb 2025 16:50:39 -0800 Subject: [PATCH] fix style app/models.py --- app/models.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/models.py b/app/models.py index 623602e..9f219aa 100644 --- a/app/models.py +++ b/app/models.py @@ -64,12 +64,20 @@ class Contributor(UserMixin, db.Model): return ''.format(self.name) def get_reset_password_token(self, expires_in=1800): - return jwt.encode({'reset_password': self.id, 'exp': time() + expires_in}, current_app.config['SECRET_KEY'], algorithm='HS256').decode('utf-8') + return jwt.encode( + {'reset_password': self.id, 'exp': time() + expires_in}, + current_app.config['SECRET_KEY'], + algorithm='HS256', + ).decode('utf-8') @staticmethod def verify_reset_password_token(token): try: - id = jwt.decode(token, current_app.config['SECRET_KEY'], algorithms=['HS256'])['reset_password'] + id = jwt.decode( + token, + current_app.config['SECRET_KEY'], + algorithms=['HS256'], + )['reset_password'] except BaseException as error: print('An exception occurred: {}'.format(error)) return Contributor.query.get(id)