Commit 22122317 authored by Vincent Le gallic's avatar Vincent Le gallic

Renommage de utilities.standard_page en utilities.get_varsock

parent fdb1e48e
......@@ -115,7 +115,7 @@ def get_photo(request, idbde=None):
except Exception as e:
return HttpResponse("Bad Request", status=400)
# On appelle alors la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
utilities._provide_photo(sock, idbde)
......@@ -130,7 +130,7 @@ def do_credit_retrait(request, action):
actions_write = {"credit": "crédit", "retrait": "retrait"}
actions_socket = {"credit": "crediter", "retrait": "retirer"}
# On appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
# on n'a pas besoin du prefix parce que le JS a filé les paramètre sans.
......@@ -156,7 +156,7 @@ def do_credit_retrait(request, action):
@csrf_exempt
def do_transfert(request):
# On appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
if request.method != "POST" or not request.POST.has_key("transfertdata"):
......
......@@ -356,7 +356,7 @@ def _display_versions():
## Gestion commmune à presque toutes les pages ##
#################################################################
def standard_page(request, socket=False):
def get_varsock(request, socket=False):
"""Fonction appelée pour générer quasiment toutes les pages (pas login).
Elle récupère la socket dans :py:mod:`keep_alive` et vérifie que la session NK2015 n'a pas timeout.
......
......@@ -115,7 +115,7 @@ def login_page(request):
def index(request):
"""La page qui ne sert à rien"""
# On appelle la fonction standard
success, sock_ou_response, variables = utilities.standard_page(request)
success, sock_ou_response, variables = utilities.get_varsock(request)
if success:
return render_to_response("note/index.html", variables, context_instance=RequestContext(request))
else:
......@@ -429,7 +429,7 @@ def mes_activites(request, idact=None, delete=None):
def del_invite(request, idact=None, idinv=None, admin=None):
"""Suppression d'un invité"""
# On appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -460,7 +460,7 @@ def toggle_transaction(request, de=None, idtransaction=None):
"""Valider/Dévalider une transaction"""
devalidate = (de == "de")
# On appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -495,13 +495,13 @@ def comptes(request, idbde=None):
return fallback_redirect
if idbde == None:
# On appelle la fonction standard, ici on n'a pas besoin de la socket
success, sock_ou_response, variables_standard = utilities.standard_page(request)
success, sock_ou_response, variables_standard = utilities.get_varsock(request)
if success:
variables.update(variables_standard)
return render_to_response("note/comptes.html", variables, context_instance=RequestContext(request))
else:
# On appelle la fonction standard, avec socket
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables.update(variables_standard)
......@@ -518,7 +518,7 @@ def historique_transactions(request,idbde=None):
if (idbde == None):
return HttpResponseRedirect('%scomptes/' % (settings.NOTE_ROOT_URL,))
# on appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -541,7 +541,7 @@ def historique_transactions(request,idbde=None):
def comptes_advanced(request):
"""Page de recherche avancée"""
# on appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -613,7 +613,7 @@ def comptes_advanced(request):
def modifier_compte(request, idbde=None):
"""Page de modification de compte"""
# on appelle la fonction standard, elle servira de toutes façon
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -686,7 +686,7 @@ def modifier_compte(request, idbde=None):
def supprimer_compte(request, idbde=None):
"""Page de confirmation de suppression de compte"""
# on appelle la fonction standard, elle servira de toutes façon
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {"button_class" : "btn-danger", "button_content" : u"Confirmer la suppression"}
......@@ -824,7 +824,7 @@ def historique_pseudo(request, idbde=None):
def search_historique_pseudo(request):
"""Page de recherche par ancien pseudo (même inactif)"""
# on appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -856,7 +856,7 @@ def search_historique_pseudo(request):
def aliases(request, idbde=None):
"""La page de gestion des aliases"""
# on appelle la fonction standard, elle servira de toutes façon
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -900,7 +900,7 @@ def aliases(request, idbde=None):
def unalias(request, idbde=None, delall=None, idalias=None):
"""Fonction appelée lorsqu'on veut supprimer un/des alias"""
# On appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -937,7 +937,7 @@ def unalias(request, idbde=None, delall=None, idalias=None):
def password(request, idbde=None):
"""Page de changement de mot de passe"""
# On appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -1017,7 +1017,7 @@ def _create_BoutonForm(sock, request, contenu=None, initial=None):
def boutons(request, idbouton=None, delete=None):
"""Page de gestion des boutons"""
# On appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -1105,7 +1105,7 @@ def boutons(request, idbouton=None, delete=None):
def preinscriptions(request):
"""Page de gestion des boutons"""
# On appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......@@ -1133,7 +1133,7 @@ def preinscriptions(request):
def inscriptions(request, preid=None, delete=None):
"""La page des consos"""
# On appelle la fonction standard
success, sock_ou_response, variables_standard = utilities.standard_page(request, socket=True)
success, sock_ou_response, variables_standard = utilities.get_varsock(request, socket=True)
if success:
sock = sock_ou_response
variables = {}
......
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