From 2304fb10f9587e3d9c64ed8251d37fb63fecd3f0 Mon Sep 17 00:00:00 2001 From: Jarmil Date: Wed, 25 Sep 2019 11:09:56 +0200 Subject: [PATCH] FIX:code culture --- src/nalodeni/views.py | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/src/nalodeni/views.py b/src/nalodeni/views.py index 2422435..8a69aa5 100644 --- a/src/nalodeni/views.py +++ b/src/nalodeni/views.py @@ -48,11 +48,7 @@ def about(request): if not request.user.is_anonymous: return HttpResponseRedirect('/ja-pirat/') - template = 'about.html' - context = { - } - - return render(request, template, context) + return render(request, 'about.html', {}) def page_eurovolby_2019(request, reg_ok=False): @@ -92,10 +88,7 @@ def page_eurovolby_2019(request, reg_ok=False): 'form' : form, 'reg_ok' : reg_ok, } - template = 'page_eurovolby_2019.html' - - return render(request, template, context) - + return render(request, 'page_eurovolby_2019.html', context) @ensure_csrf_cookie @@ -223,7 +216,6 @@ def join_pirates(request): 'AUTH_AVAIL_IDP' : appSettings.AUTH_AVAIL_IDP, 'form' : form, } - return render(request, template, context) @@ -308,7 +300,6 @@ def follow_pirates(request): # create registration without sending email rt = form.instance rt.dc_stamp = datetime.now() - #rt.etStamp = datetime.now() rt.save() request.session['fillFormFor'] = rt.id @@ -319,7 +310,6 @@ def follow_pirates(request): else: rt = form.instance rt.dc_stamp = datetime.now() - #rt.etStamp = datetime.now() rt.save() nalodeni_auth.sendRegisterTokenReg(rt) @@ -337,7 +327,6 @@ def follow_pirates(request): context = { 'form' : form, } - return render(request, template, context) @@ -477,7 +466,6 @@ def prihlaseni(request): return render(request, template, context) - @login_required(login_url="/prihlaseni") def email_vizitka(request): """ HTML vizitka pro emaily """ @@ -497,7 +485,6 @@ def email_vizitka(request): return render(request, template, context) - @login_required(login_url="/prihlaseni") @transaction.atomic def profil(request): @@ -588,14 +575,11 @@ def profil(request): else: form = None - template = 'profil.html' context = { 'form' : form, 'AUTH_SERVER' : appSettings.AUTH_SERVER, } - - return render(request, template, context) - + return render(request, 'profil.html', context) @login_required(login_url="/prihlaseni") @@ -630,12 +614,11 @@ def dotaznik(request): else: form = None - template = 'dotaznik.html' context = { 'form' : form, } + return render(request, 'dotaznik.html', context) - return render(request, template, context) @transaction.atomic def dotaznik2(request): @@ -672,12 +655,10 @@ def dotaznik2(request): else: form = None - template = 'dotaznik.html' context = { 'form' : form, } - - return render(request, template, context) + return render(request, 'dotaznik.html', context) @transaction.atomic @@ -715,11 +696,8 @@ def dotaznik_follow(request): else: form = None - template = 'dotaznik_follow.html' context = { 'form' : form, } - - return render(request, template, context) - + return render(request, 'dotaznik_follow.html', context)