diff --git a/server/core/management/commands/update_admin_token.py b/server/core/management/commands/update_admin_token.py new file mode 100644 index 00000000..f2b11bab --- /dev/null +++ b/server/core/management/commands/update_admin_token.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# +# ITerativ GmbH +# http://www.iterativ.ch/ +# +# Copyright (c) 2020 ITerativ GmbH. All rights reserved. +# +# Created on 24.02.20 +# @author: chrigu +import os +import shutil + +from django.core.management import BaseCommand + +from core.models import AdminData + + +class Command(BaseCommand): + + def handle(self, *args, **options): + "Update admin token via cronjob" + AdminData.objects.update_admin_token() + diff --git a/server/users/management/commands/sync_licenses.py b/server/users/management/commands/sync_licenses.py index 16754b72..544c3332 100644 --- a/server/users/management/commands/sync_licenses.py +++ b/server/users/management/commands/sync_licenses.py @@ -20,13 +20,6 @@ from users.models import User, License class Command(BaseCommand): - def ensure_clean_dir(self, folder): - path = os.path.join(settings.MEDIA_ROOT, folder) - if os.path.exists(path): - shutil.rmtree(path) - if not os.path.exists(path): - os.makedirs(path) - def handle(self, *args, **options): "Update licenses via cronjob"