[odrs-web/oscp] Prevent crash when moderators have no password set
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [odrs-web/oscp] Prevent crash when moderators have no password set
- Date: Wed, 29 Apr 2020 17:59:57 +0000 (UTC)
commit 2c314ca35b9745ab67d3d7c25add5e7cd9f04e43
Author: Richard Hughes <richard hughsie com>
Date: Wed Apr 29 18:57:41 2020 +0100
Prevent crash when moderators have no password set
app_data/odrs/models.py | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/app_data/odrs/models.py b/app_data/odrs/models.py
index 14a7355..10662bf 100644
--- a/app_data/odrs/models.py
+++ b/app_data/odrs/models.py
@@ -361,6 +361,8 @@ class Moderator(db.Model):
self.password_hash = generate_password_hash(password)
def verify_password(self, password):
+ if not self.password_hash:
+ return False
# on success, upgrade the old hashing function to the new secure one
if len(self.password_hash) == 40:
if self.password_hash != _password_hash(password):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]