Skip to content

Commit

Permalink
Merge pull request #98 from codeforjapan/feature/fix-digits
Browse files Browse the repository at this point in the history
Fix digits
  • Loading branch information
yu23ki14 authored Aug 17, 2024
2 parents b32a749 + f21b25a commit c428124
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/birdxplorer_common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class UpToNineteenDigitsDecimalString(BaseString):
Traceback (most recent call last):
...
pydantic_core._pydantic_core.ValidationError: 1 validation error for function-after[validate(), constrained-str]
String should match pattern '^([0-9]{18,19}|)$' [type=string_pattern_mismatch, input_value='test', input_type=str]
String should match pattern '^([0-9]{1,19}|)$' [type=string_pattern_mismatch, input_value='test', input_type=str]
...
>>> UpToNineteenDigitsDecimalString.from_str("1234567890123456789")
UpToNineteenDigitsDecimalString('1234567890123456789')
Expand All @@ -144,7 +144,7 @@ class UpToNineteenDigitsDecimalString(BaseString):

@classmethod
def __get_extra_constraint_dict__(cls) -> dict[str, Any]:
return dict(super().__get_extra_constraint_dict__(), pattern=r"^([0-9]{18,19}|)$")
return dict(super().__get_extra_constraint_dict__(), pattern=r"^([0-9]{1,19}|)$")


class NonEmptyStringMixin(BaseString):
Expand Down

0 comments on commit c428124

Please sign in to comment.