diff --git a/TODO b/TODO index d05becc..4670e0b 100644 --- a/TODO +++ b/TODO @@ -4,6 +4,4 @@ * enforce Mac OS if Mac is choosen? -* Maintainance-Anzeige im Debugmodus, damit niemand denkt, es würden mails verschickt. - * better error handling with mail sending. diff --git a/evapp/templates/evapp/employee_form.html b/evapp/templates/evapp/employee_form.html index 49e0bd9..e95669d 100644 --- a/evapp/templates/evapp/employee_form.html +++ b/evapp/templates/evapp/employee_form.html @@ -29,6 +29,9 @@ + {% if TESTMODE %} +
Du bist eingeloggt als {{ user.email }} diff --git a/evapp/tests.py b/evapp/tests.py index 57431b5..f71ae35 100644 --- a/evapp/tests.py +++ b/evapp/tests.py @@ -20,7 +20,7 @@ class LoginTestCase(TestCase): self.assertContains(self.response, "WARNUNG! Test-MODUS aktiviert. Es werden keine Mails verschickt!", status_code=200) -class SimpleTest(TestCase): +class NoLoginTestCase(TestCase): def setUp(self): self.client = Client() diff --git a/evapp/views.py b/evapp/views.py index 0ad6948..02d29a3 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -83,8 +83,10 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): #print('GETCONTEXT') context = super().get_context_data(form=form, **kwargs) + #testmode = settings.DEBUG or settings.MAILTEST context.update({'choice': self.choice, - 'choice_string': TYPE_CHOICES[self.choice]}) + 'choice_string': TYPE_CHOICES[self.choice], + 'TESTMODE': settings.DEBUG or settings.MAILTEST}) # deliver context for forms if we are in the last step if (self.steps.step1 == 5 or (self.choice != 'IN' and self.steps.step1 == 3)):