Fix multiple form and table issues

This commit is contained in:
Jan Tuomi
2017-10-28 16:50:38 +03:00
parent 402cdc3533
commit 331d4b86b9
19 changed files with 830 additions and 713 deletions
-10
View File
@@ -1,10 +0,0 @@
{% extends "base.html" %}
{% block navigation %}
{% endblock navigation %}
{% block content %}
<div class="alert alert-danger" role="alert">
{{ errors|safe }}
</div>
{% endblock content %}
+18
View File
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% block content %}
<div>
<div>
<h3>{% trans "Error" %}</h3>
</div>
<div class="alert alert-danger">
{{ error|safe }}
</div>
<div>
<button onclick="window.history.back();" class="btn btn-primary">{% trans "Back" %}</button>
</div>
</div>
{% endblock content %}
+4 -4
View File
@@ -184,9 +184,9 @@ def kaehmy_submit(request, *args, **kwargs):
else:
context = {
'errors': form.errors
'error': form.errors
}
return render(request, 'error.html', context)
return render(request, 'kaehmy_error.html', context)
return HttpResponseRedirect('/kaehmy')
@@ -283,9 +283,9 @@ def kaehmy_comment(request, *args, **kwargs):
else:
print(form)
context = {
'errors': form.errors
'error': form.errors
}
return render(request, 'error.html', context)
return render(request, 'kaehmy_error.html', context)
@require_http_methods(["GET"])