This repository was archived by the owner on Apr 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,15 @@ class Contact(BaseModel):
18
18
The URL pointing to the contact information. MUST be in the format of a URL.
19
19
"""
20
20
21
- email : Optional [Union [EmailStr ,str ]] = None
21
+ email : Optional [Union [EmailStr , str ]] = None
22
22
"""
23
23
The email address of the contact person/organization. MUST be in the format of an email address.
24
24
"""
25
+
25
26
@validator ("email" , pre = True )
26
27
def validate_email ( # pylint: disable=no-self-argument
27
- cls , v : Union [EmailStr , str ],
28
+ cls ,
29
+ v : Union [EmailStr , str ],
28
30
) -> EmailStr :
29
31
"""Validates that email is a valid email address
30
32
@@ -41,7 +43,6 @@ def validate_email( # pylint: disable=no-self-argument
41
43
v = EmailStr (v )
42
44
return v
43
45
44
-
45
46
class Config :
46
47
extra = Extra .ignore
47
48
schema_extra = {
Original file line number Diff line number Diff line change @@ -24,9 +24,11 @@ class Contact(BaseModel):
24
24
The email address of the contact person/organization.
25
25
MUST be in the form of an email address.
26
26
"""
27
+
27
28
@validator ("email" , pre = True )
28
29
def validate_email ( # pylint: disable=no-self-argument
29
- cls , v : Union [EmailStr , str ],
30
+ cls ,
31
+ v : Union [EmailStr , str ],
30
32
) -> EmailStr :
31
33
"""Validates that email is a valid email address
32
34
You can’t perform that action at this time.
0 commit comments