From 0bad647b32d4c9429943c677b9d6b1bdd7ac6afe Mon Sep 17 00:00:00 2001 From: Yoann Pietri Date: Sat, 27 Jan 2018 23:15:01 +0100 Subject: [PATCH] =?UTF-8?q?Affiche=20les=20CGU=20que=20lorsqu'on=20cr?= =?UTF-8?q?=C3=A9e=20un=20nouvel=20utilisateur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/templates/users/user.html | 2 ++ users/views.py | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/users/templates/users/user.html b/users/templates/users/user.html index 20931031..fc8d06d0 100644 --- a/users/templates/users/user.html +++ b/users/templates/users/user.html @@ -37,9 +37,11 @@ with this program; if not, write to the Free Software Foundation, Inc., {% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
+{% if showCGU %}

En cliquant sur Créer ou modifier, l'utilisateur s'engage à respecter les règles d'utilisation du réseau.

Résumé des règles d'utilisations

{{ GTU_sum_up }}

+{% endif %}


diff --git a/users/views.py b/users/views.py index c8c340b9..40fd80d0 100644 --- a/users/views.py +++ b/users/views.py @@ -138,7 +138,7 @@ def new_user(request): 'users:profil', kwargs={'userid':str(user.id)} )) - return form({'userform': user,'GTU_sum_up':GTU_sum_up,'GTU':GTU}, 'users/user.html', request) + return form({'userform': user,'GTU_sum_up':GTU_sum_up,'GTU':GTU,'showCGU':True}, 'users/user.html', request) @login_required @@ -160,7 +160,7 @@ def new_club(request): 'users:profil', kwargs={'userid':str(club.id)} )) - return form({'userform': club}, 'users/user.html', request) + return form({'userform': club, 'showCGU':False}, 'users/user.html', request) @login_required @@ -181,7 +181,7 @@ def edit_club_admin_members(request, club_instance, clubid): 'users:profil', kwargs={'userid':str(club_instance.id)} )) - return form({'userform': club}, 'users/user.html', request) + return form({'userform': club, 'showCGU':False}, 'users/user.html', request) @login_required @@ -366,7 +366,7 @@ def add_ban(request, user, userid): request, "Attention, cet utilisateur a deja un bannissement actif" ) - return form({'userform': ban}, 'users/user.html', request) + return form({'userform': ban}, 'users/user.html', request) @login_required @can_edit(Ban) @@ -415,7 +415,7 @@ def add_whitelist(request, user, userid): request, "Attention, cet utilisateur a deja un accès gracieux actif" ) - return form({'userform': whitelist}, 'users/user.html', request) + return form({'userform': whitelist}, 'users/user.html', request) @login_required