Add update admin token command
This commit is contained in:
parent
f62d2ad5ef
commit
fff752f59d
|
|
@ -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()
|
||||||
|
|
||||||
|
|
@ -20,13 +20,6 @@ from users.models import User, License
|
||||||
|
|
||||||
class Command(BaseCommand):
|
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):
|
def handle(self, *args, **options):
|
||||||
"Update licenses via cronjob"
|
"Update licenses via cronjob"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue