Skip to content

Commit 5a871f2

Browse files
Merge pull request #325 from RSE-Sheffield/fix/system-check-import
Fix system check registration
2 parents 453f90c + 14f5db7 commit 5a871f2

File tree

8 files changed

+17
-6
lines changed

8 files changed

+17
-6
lines changed

SORT/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
from SORT.checks import *

SORT/checks/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

home/apps.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,13 @@
44
class HomeConfig(AppConfig):
55
default_auto_field = "django.db.models.BigAutoField"
66
name = "home"
7+
8+
def ready(self):
9+
"""
10+
Initialise this app
11+
"""
12+
# Load system checks
13+
# https://docs.djangoproject.com/en/5.2/topics/checks/
14+
# Suppress linting errors
15+
import home.checks # noqa: F401
16+
import survey.checks # noqa: F401
File renamed without changes.

home/checks/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .vite_manifest import check_manifest
2+
3+
__all__ = ["check_survey_config"]

SORT/checks/vite_manifest.py renamed to home/checks/vite_manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def check_manifest(*args, **kwargs) -> list[django.core.checks.Error]:
2121
if not getattr(settings, 'VITE_MANIFEST_FILE_PATH', None):
2222
errors.append(
2323
django.core.checks.Error(
24-
f"Setting not defined VITE_MANIFEST_FILE_PATH",
24+
"Setting not defined VITE_MANIFEST_FILE_PATH",
2525
hint="Add VITE_MANIFEST_FILE_PATH to settings.py",
2626
id="SORT.E001",
2727
),

survey/checks/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .survey_config import check_survey_config
2+
3+
__all__ = ["check_survey_config"]
File renamed without changes.

0 commit comments

Comments
 (0)