Fakultas Ilmu Komputer UI

Commit d6baf564 authored by Nurul Srianda Putri's avatar Nurul Srianda Putri
Browse files

[GREEN] Implement phone number cannot contain alphabet

parent 2172a0b3
Pipeline #65428 passed with stages
in 1 minute and 40 seconds
......@@ -40,6 +40,8 @@ class RegisterAccountSerializer(AccountSerializer):
)
if phone_number[0] != "8":
raise ValidationError(_("Phone number must start with 8."))
if not re.match(r"^8[0-9]*$", phone_number):
raise ValidationError(_("Phone number cannot contain alphabet."))
return data
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment