Added setup errors banner to welcome page.

This commit is contained in:
Tiberiu Chibici 2018-12-30 12:43:14 +02:00
parent 21a05614f2
commit 457b0c4dc9
5 changed files with 14 additions and 2 deletions

View File

@ -4,6 +4,9 @@
{% block body %} {% block body %}
<div class="container"> <div class="container">
{% include "YtManagerApp/controls/setup_errors_banner.html" %}
<h1>Welcome</h1> <h1>Welcome</h1>
<p>This wizard will guide you through setting up the application.</p> <p>This wizard will guide you through setting up the application.</p>
{% crispy form %} {% crispy form %}

View File

@ -24,7 +24,7 @@
</div> </div>
</div> </div>
{% include 'YtManagerApp/index_errors_banner.html' %} {% include 'YtManagerApp/controls/setup_errors_banner.html' %}
<div class="row"> <div class="row">

View File

@ -3,7 +3,7 @@
{% block body %} {% block body %}
{% include 'YtManagerApp/index_errors_banner.html' %} {% include 'YtManagerApp/controls/setup_errors_banner.html' %}
<h1>Hello</h1> <h1>Hello</h1>
<h2>Please log in to continue</h2> <h2>Please log in to continue</h2>

View File

@ -1,5 +1,6 @@
import logging import logging
from django.conf import settings
from django.contrib.auth import authenticate, login from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.http import HttpResponseForbidden from django.http import HttpResponseForbidden
@ -44,6 +45,14 @@ class Step0WelcomeView(WizardStepMixin, FormView):
form_class = WelcomeForm form_class = WelcomeForm
success_url = reverse_lazy('first_time_1') success_url = reverse_lazy('first_time_1')
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({
'config_errors': settings.CONFIG_ERRORS,
'config_warnings': settings.CONFIG_WARNINGS,
})
return context
# #
# Step 1: setup API key # Step 1: setup API key