Be sure not to use blank passwords as the password

This commit is contained in:
dgtlmoon
2021-06-21 22:12:47 +10:00
parent a429223858
commit 45bd454e26
2 changed files with 9 additions and 5 deletions

View File

@@ -46,11 +46,12 @@ class SaltyPasswordField(StringField):
# incoming
def process_formdata(self, valuelist):
if valuelist:
# Remove empty strings
self.encrypted_password = self.build_password(valuelist[0])
self.data = []
# Be really sure it's non-zero in length
if len(valuelist[0].strip()) > 0:
self.encrypted_password = self.build_password(valuelist[0])
self.data = ""
else:
self.data = []
self.data = False
# Separated by key:value