Import nicht mehr aufrufbar

This commit is contained in:
Holger Trampe 2021-10-24 16:01:10 +02:00
parent cfb50385fd
commit 74a6b2d0c2
1 changed files with 14 additions and 0 deletions

View File

@ -671,6 +671,13 @@ class AdmAddBreak(CreateView):
class AdmImport(TemplateView): class AdmImport(TemplateView):
template_name="adm/adm_import_overview.html" template_name="adm/adm_import_overview.html"
def dispatch(self, *args, **kwargs):
if(checkForStuffUser(self.request)):
return super().dispatch(*args, **kwargs)
else:
messages.warning(self.request, f'Sie benötigen einen Mitarbeiter-Account, um diese Seiten aufzurufen!')
return redirect("login")
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
context.update({'active_link' : 'adm-import'}) context.update({'active_link' : 'adm-import'})
@ -684,6 +691,13 @@ from cloud.models import *
class AdmImportFlow(TemplateView): class AdmImportFlow(TemplateView):
template_name="adm/adm_import_flow.html" template_name="adm/adm_import_flow.html"
def dispatch(self, *args, **kwargs):
if(checkForStuffUser(self.request)):
return super().dispatch(*args, **kwargs)
else:
messages.warning(self.request, f'Sie benötigen einen Mitarbeiter-Account, um diese Seiten aufzurufen!')
return redirect("login")
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
context.update({'active_link' : 'adm-import'}) context.update({'active_link' : 'adm-import'})