Skip to content

Commit

Permalink
fix(i18n): validate existing paths
Browse files Browse the repository at this point in the history
  • Loading branch information
lt-mayonesa committed Nov 13, 2023
1 parent e772016 commit 0b268e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hexagon/support/input/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __get_validators__(cls, *args, **kwargs):
def validate(cls, value: Path, field) -> Path:
declaration_extras = copy(field.field_info.extra)

if declaration_extras.get("allow_nonexistent", True):
if not declaration_extras.get("allow_nonexistent", False):
if not value.exists():
raise FileNotExistsError(path=value)

Expand All @@ -50,7 +50,7 @@ def __get_validators__(cls):
def validate(cls, value: Path, field) -> Path:
declaration_extras = copy(field.field_info.extra)

if declaration_extras.get("allow_nonexistent", True):
if not declaration_extras.get("allow_nonexistent", False):
if not value.exists():
raise DirectoryNotExistsError(path=value)

Expand Down

0 comments on commit 0b268e6

Please sign in to comment.