Skip to content

Commit 69114a6

Browse files
author
Coding
committed
fixed a bug where a user could enter empty characters
1 parent 984d0dd commit 69114a6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/dbo/actions.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ def change_password(self, user: User, new_password: str) -> None:
4646
raise InvalidPassword("Invalid password")
4747

4848
def __validate_data(self, credentials: User) -> bool:
49+
if credentials.data is None:
50+
return False
4951
if "" in credentials.data:
5052
return False
5153
for i in credentials.data:
52-
if i.__contains__(" "):
53-
return False
54+
if i is None:
55+
continue
56+
for j in i:
57+
if j == " ":
58+
return False
5459
return True
5560

5661
def __validate_password(self, credentials: User) -> bool:

0 commit comments

Comments
 (0)