Skip to content
Snippets Groups Projects

correct typing and fix a bug

Merged Mohammad Torkashvand requested to merge refactor/improve-lat-lon-validation into develop
All threads resolved!
+ 2
2
@@ -13,7 +13,7 @@ class LatitudeCoordinate(ConstrainedStr):
"""
regex = re.compile(r"^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$")
regex = re.compile(r"^-?([1-8]?\d(\.\d+)?|90(\.0+)?)$")
@classmethod
def validate(cls, value: Union[str]) -> Union[str]:
@@ -32,7 +32,7 @@ class LongitudeCoordinate(ConstrainedStr):
"""
regex = re.compile(r"^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$")
regex = re.compile(r"^-?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$")
@classmethod
def validate(cls, value: Union[str]) -> Union[str]:
Loading