Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.10/site-packages/django/core/checks/files.py: 56%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

9 statements  

1from pathlib import Path 

2 

3from django.conf import settings 

4 

5from . import Error, Tags, register 

6 

7 

8@register(Tags.files) 

9def check_setting_file_upload_temp_dir(app_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 []