Skip to content

Commit

Permalink
solution
Browse files Browse the repository at this point in the history
  • Loading branch information
vsvarvariuk committed Dec 24, 2024
1 parent 343db1c commit 734a945
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions taxi/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

def validate_license_number(lic_number: str) -> str:
if len(lic_number) != 8:
raise ValidationError("License number must be exactly 8 characters long")
raise ValidationError("License number must be exactly "
"8 characters long")
elif len(lic_number) == 8:
for i in range(0, 3):
if lic_number[i] != lic_number[i].capitalize():
raise ValidationError("The first 3 letters must be capitalized")
raise ValidationError("The first 3 letters "
"must be capitalized")
if not lic_number[i].isalpha():
raise ValidationError("The first 3 characters must be letters")
for elem in range(3, 8):
Expand Down

0 comments on commit 734a945

Please sign in to comment.