Skip to content

Commit 9855c2d

Browse files
committed
Added a check for the existence of the media/photos directory.
- Legacy-Id: 11315
1 parent 9eacdbf commit 9855c2d

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

ietf/checks.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def check_doc_email_aliases_exists(app_configs, **kwargs):
7171
@checks.register('directories')
7272
def check_id_submission_directories(app_configs, **kwargs):
7373
errors = []
74-
for s in ("IDSUBMIT_STAGING_PATH", "IDSUBMIT_REPOSITORY_PATH", "INTERNET_DRAFT_ARCHIVE_DIR"):
74+
for s in ("IDSUBMIT_STAGING_PATH", "IDSUBMIT_REPOSITORY_PATH", "INTERNET_DRAFT_ARCHIVE_DIR", ):
7575
p = getattr(settings, s)
7676
if not os.path.exists(p):
7777
errors.append(checks.Critical(
@@ -142,3 +142,21 @@ def check_id_submission_checkers(app_configs, **kwargs):
142142
id = "datatracker.E0011",
143143
))
144144
return errors
145+
146+
@checks.register('directories')
147+
def check_media_directories(app_configs, **kwargs):
148+
errors = []
149+
for s in ("PHOTOS_DIR", ):
150+
p = getattr(settings, s)
151+
if not os.path.exists(p):
152+
errors.append(checks.Critical(
153+
"A directory used for media uploads and serves does not exist at the path given\n"
154+
"in the settings file. The setting is:\n"
155+
" %s = %s" % (s, p),
156+
hint = ("Please either update the local settings to point at the correct directory,"
157+
"or if the setting is correct, create the directory."),
158+
id = "datatracker.E0012",
159+
))
160+
return errors
161+
162+

0 commit comments

Comments
 (0)