team-3/src/c3nav/mapdata/management/commands/clearmapcache.py

15 lines
505 B
Python
Raw Normal View History

from django.conf import settings
2017-07-05 22:42:50 +02:00
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy as _
2017-07-05 22:42:50 +02:00
class Command(BaseCommand):
help = 'clear the mapdata cache'
def handle(self, *args, **options):
from c3nav.mapdata.models import MapUpdate
MapUpdate.objects.create(type='management')
if not settings.HAS_REAL_CACHE:
print(_('You have no external cache configured, so don\'t forget to restart your c3nav instance!'))