Coverage for /Users/davegaeddert/Development/dropseed/plain/plain/plain/preflight/files.py: 56%

1 from pathlib import Path

2

3 from plain.runtime import settings

4

5 from . import Error, register

6

7

8@register

9 def check_setting_file_upload_temp_dir(package_configs, **kwargs):

10 setting = getattr(settings, "FILE_UPLOAD_TEMP_DIR", None)

11 if setting and not Path(setting).is_dir():

12 return [

13 Error(

14 f"The FILE_UPLOAD_TEMP_DIR setting refers to the nonexistent "

15 f"directory '{setting}'.",

16 id="files.E001",

17 ),

18 ]

19 return []