aboutsummaryrefslogtreecommitdiffstats
path: root/manage.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2023-07-11 21:54:59 +0200
committerGravatar Johannes Christ <[email protected]>2023-07-11 21:55:39 +0200
commit0a897b9f717bf081f7ec931f3abf67a5874789ec (patch)
treec6ad213dae0ca93efc33b3054e788ac7ac0da225 /manage.py
parentBump whitenoise from 6.4.0 to 6.5.0 (diff)
Fix warning ignore
Additionally, use stdlib API instead of undocumented Django test API Co-authored-by: Chris Lovering <[email protected]>
Diffstat (limited to 'manage.py')
-rwxr-xr-xmanage.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/manage.py b/manage.py
index afca6121..80601935 100755
--- a/manage.py
+++ b/manage.py
@@ -2,12 +2,12 @@
import os
import platform
import sys
+import warnings
from pathlib import Path
import django
from django.contrib.auth import get_user_model
from django.core.management import call_command, execute_from_command_line
-from django.test.utils import ignore_warnings
DEFAULT_ENVS = {
"DJANGO_SETTINGS_MODULE": "pydis_site.settings",
@@ -160,11 +160,12 @@ class SiteManager:
# tests, staticfiles are not, and do not need to be generated.
# The following line suppresses the warning.
# Reference: https://github.com/evansd/whitenoise/issues/215
- with ignore_warnings(
- message=r"No directory at: .*staticfiles",
- module="whitenoise.base",
- ):
- call_command(*sys.argv[1:])
+ warnings.filterwarnings(
+ action='ignore',
+ category=UserWarning,
+ message=r"^No directory at: .*staticfiles/$"
+ )
+ call_command(*sys.argv[1:])
def clean_up_static_files(build_folder: Path) -> None: