8 lines
203 B
Python
8 lines
203 B
Python
|
from django.core.exceptions import ValidationError
|
||
|
|
||
|
from pathlib import Path
|
||
|
|
||
|
|
||
|
def validate_directory(value):
|
||
|
if not Path(value).is_dir():
|
||
|
raise ValidationError(f"{value} is not a directory")
|