Commit 3058274a authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

Render remplace render to response

parent 5505eb57
......@@ -164,7 +164,7 @@ def view(request):
'pageno' : form.cleaned_data["pageno"],} for form in uploadform if form.cleaned_data.has_key("fichier")]
printform = formset_factory(PrintForm, extra=0)
printform = printform(initial=initial_data)
return render_to_response("impressions/print.html",
return render(request, "impressions/print.html",
{'printform': printform,
'une_agrafe': ["hg", "hd", "bg", "bd"],
'deux_agrafes': ["g", "d"],
......@@ -172,8 +172,7 @@ def view(request):
'solde_club' : get_solde_clubs(request),
'solde_actif': solde,
'config_prix': config_prix,
'uploadform' : uploadform,},
context_instance=RequestContext(request))
'uploadform' : uploadform,})
else:
for form_errors in uploadform.errors:
for errorlist in form_errors.values():
......@@ -183,10 +182,9 @@ def view(request):
messages.error(request, error)
uploadform = formset_factory(UploadForm, formset=UploadFormSet)
clubform = ClubForm(ldap_user)
return render_to_response("impressions/impressions.html",\
return render(request, "impressions/impressions.html",\
{'uploadform': uploadform,
'clubform' : clubform},\
context_instance=RequestContext(request))
'clubform' : clubform})
elif "SubmitPrintForm" in request.POST.keys():
# Avant toute chose, on vérifie l'état de l'imprimante, sinon on redirige
try:
......@@ -342,12 +340,11 @@ def gestion(request):
# On précise si la personne est imprimeur
imprimeur = is_imprimeur(request)
return render_to_response("impressions/liste.html",
return render(request, "impressions/liste.html",
{"ended_jobs" : ended_jobs,
"lpq_jobs" : lpq_jobs,
"imprimeur" : imprimeur,
"imprimante_jobs" : imprimante_jobs},
context_instance=RequestContext(request))
"imprimante_jobs" : imprimante_jobs})
def make_recredit(request, crans_jid, imprimeur_not_required=False):
......
......@@ -114,7 +114,7 @@ def view(request, batiment = None):
l = locals()
l['PAGES'] = PAGES
return django.shortcuts.render_to_response("prises/prises.html", l, context_instance=RequestContext(request))
return django.shortcuts.render(request, "prises/prises.html", l)
@permission_required('prises.can_view')
def validate(request, batiment = None):
......@@ -135,4 +135,4 @@ def validate(request, batiment = None):
formset = ValidPriseFormSet(queryset = Prise.objects.filter(batiment = batiment, cablage_effectue = False).order_by('crans', 'prise_crous'))
l = locals()
l['PAGES'] = PAGES
return django.shortcuts.render_to_response("prises/validate.html", l, context_instance=RequestContext(request))
return django.shortcuts.render(request, "prises/validate.html", l)
......@@ -142,7 +142,7 @@ def tv(request, autoplay_type=None, autoplay_url=None):
request.session['autoplay_volume'] = None
# Render de la page
return django.shortcuts.render_to_response("tv/index.html", params, context_instance=RequestContext(request))
return django.shortcuts.render(request, "tv/index.html", params)
@request_passes_test(check_local_or_logged)
def radio_playlist(request, radio):
......
......@@ -57,7 +57,7 @@ def get_xml(request):
return HttpResponse(doc.toxml('utf-8'),content_type='text/xml; coding=utf-8')
def index(request):
return django.shortcuts.render_to_response('wifimap/index.html', locals(), context_instance=RequestContext(request))
return django.shortcuts.render(request, 'wifimap/index.html', locals())
@csrf_exempt
@permission_required('wifimap.change_virtAP')
......@@ -114,7 +114,7 @@ def change_conf(request):
#print wifi_action.cleaned_data['actions_possibles']
option = str(wifi_action.cleaned_data['actions_possibles'])
# On renvoie tout pour les menus secondaires.
return django.shortcuts.render_to_response('wifimap/change_conf.html', locals(), context_instance=RequestContext(request))
return django.shortcuts.render(request, 'wifimap/change_conf.html', locals())
# Etape 2 : info supplémentaires et zone cible
if bornes_cibles.is_valid() and 'option' in request.POST.keys():
......@@ -130,7 +130,7 @@ def change_conf(request):
# Si c'est pas valide, excepté les cas triviaux, on envoie bouler pour eviter une commande foireuse sur les bornes
if option!="hostapd" or option!="network":
if not wifi_info.is_valid():
return django.shortcuts.render_to_response('wifimap/change_conf.html', locals(), context_instance=RequestContext(request))
return django.shortcuts.render(request, 'wifimap/change_conf.html', locals())
# On format pour les commandes complexes (vlan, add ssid)
if option=="vlan":
......@@ -154,5 +154,5 @@ def change_conf(request):
# On retourne à l'user
messages.success(request, _(u"""La configuration a été prise en compte"""))
return django.shortcuts.redirect("/wifimap/")
return django.shortcuts.render_to_response('wifimap/change_conf.html', locals(), context_instance=RequestContext(request))
return django.shortcuts.render_to_response('wifimap/change_conf.html', locals(), context_instance=RequestContext(request))
return django.shortcuts.render(request, 'wifimap/change_conf.html', locals())
return django.shortcuts.render(request, 'wifimap/change_conf.html', locals())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment