Skip to content

Commit

Permalink
Improving email domain name validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ajha63 committed Oct 5, 2024
1 parent 77f39e0 commit cc47aa8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doctors/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class Meta:
fields = '__all__'

def validate_email(self, value):
if "@example.com" in value:
if "@plainsboroteaching.care" in value:
return value
raise serializers.ValidationError("El correo debe incluir @example.com")
raise serializers.ValidationError("Solo correos del dominio @plainsboroteaching.care son permitidos")

def validate(self, attrs):
if len(attrs['contact_number']) < 10 and attrs['is_on_vacation']:
Expand Down

0 comments on commit cc47aa8

Please sign in to comment.