Merge pull request #16760 from edx/bmedx/django111_remove_noargscommand

Update clear_collectstatic_cache management command to Django 1.11 spec
This commit is contained in:
Brian Mesick
2017-12-04 14:19:44 -05:00
committed by GitHub

View File

@@ -1,14 +1,21 @@
### """
### Script for importing courseware from XML format Django management command to clear the 'staticfiles' Django cache
### """
from django.core.management.base import NoArgsCommand from __future__ import print_function
from django.core.management.base import BaseCommand
from django.core.cache import caches from django.core.cache import caches
class Command(NoArgsCommand): class Command(BaseCommand):
help = 'Import the specified data directory into the default ModuleStore' """
Implementation of the management command
"""
def handle_noargs(self, **options): help = 'Empties the Django caches["staticfiles"] cache.'
def handle(self, *args, **_):
staticfiles_cache = caches['staticfiles'] staticfiles_cache = caches['staticfiles']
staticfiles_cache.clear() staticfiles_cache.clear()
print("Cache cleared.")