team-3/src/c3nav/site/management/commands/createsiteupdate.py
2017-12-24 01:13:44 +01:00

15 lines
470 B
Python

from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'create a site update, asking users to reload the page'
def handle(self, *args, **options):
result = input('Type YES to create a new site update: ')
if result == 'YES':
from c3nav.mapdata.models import SiteUpdate
SiteUpdate.objects.create()
print('New site update created.')
else:
print('Aborted.')