diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2020-05-06 22:29:32 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-05-08 12:47:57 +0200 |
| commit | 87faeee4e0c0eb3937e2e575794f4512e513d214 (patch) | |
| tree | 26904ea93ddd2b305a24331937aea3b0e384bdee /django | |
| parent | b23e3a1caa10f824b6a0f8bbfaaab7fe53ac3abf (diff) | |
Fixed #31528 -- Made collectstatic management command run staticfiles checks.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/staticfiles/management/commands/collectstatic.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/django/contrib/staticfiles/management/commands/collectstatic.py b/django/contrib/staticfiles/management/commands/collectstatic.py index 9c90fb09b4..ff630fd413 100644 --- a/django/contrib/staticfiles/management/commands/collectstatic.py +++ b/django/contrib/staticfiles/management/commands/collectstatic.py @@ -3,6 +3,7 @@ import os from django.apps import apps from django.contrib.staticfiles.finders import get_finders from django.contrib.staticfiles.storage import staticfiles_storage +from django.core.checks import Tags from django.core.files.storage import FileSystemStorage from django.core.management.base import BaseCommand, CommandError from django.core.management.color import no_style @@ -36,6 +37,10 @@ class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( + '--skip-checks', action='store_true', + help='Skip system checks.', + ) + parser.add_argument( '--noinput', '--no-input', action='store_false', dest='interactive', help="Do NOT prompt the user for input of any kind.", ) @@ -146,6 +151,8 @@ class Command(BaseCommand): def handle(self, **options): self.set_options(**options) + if not options['skip_checks']: + self.check(tags=[Tags.staticfiles]) message = ['\n'] if self.dry_run: |
