Add update admin token command

This commit is contained in:
Christian Cueni 2020-02-24 16:22:48 +01:00
parent f62d2ad5ef
commit fff752f59d
2 changed files with 23 additions and 7 deletions

View File

@ -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 <christian.cueni@iterativ.ch>
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()

View File

@ -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"