Skip to content

Commit

Permalink
Merge pull request #44 from wafflestudio/not_space
Browse files Browse the repository at this point in the history
비밀번호, 참여코드에 공백 불가능하도록
  • Loading branch information
odumag99 authored Jan 26, 2025
2 parents 05b709a + a9c3297 commit 1f75255
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions snuvote/app/user/dto/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def validate_password(value: str) -> str:
contains_special = False

for char in value:
#공백있으면 에러
if char.isspace():
raise InvalidFieldFormatError()

if char.isupper():
contains_uppercase = True
elif char.islower():
Expand Down
4 changes: 4 additions & 0 deletions snuvote/app/vote/dto/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def validate_content(value: str) -> str:
def validate_participation_code(value: str) -> str:
if len(value) != 6:
raise InvalidFieldFormatError()
#공백이 있으면 에러
if any(char.isspace() for char in value):
raise InvalidFieldFormatError()

return value

"""
Expand Down

0 comments on commit 1f75255

Please sign in to comment.