Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 998d093c authored by chirac's avatar chirac

Merge branch 'rm_whitlist' into 'master'

Rm whitlist

See merge request federez/re2o!175
parents 23001bf3 3e244b8b
......@@ -47,6 +47,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ whitelist.date_start }}</td>
<td>{{ whitelist.date_end }}</td>
<td class="text-right">
{% can_delete whitelist %}
{% include 'buttons/suppr.html' with href='users:del-whitelist' id=whitelist.id %}
{% acl_end %}
{% can_edit whitelist %}
{% include 'buttons/edit.html' with href='users:edit-whitelist' id=whitelist.id %}
{% acl_end %}
......
......@@ -62,6 +62,9 @@ urlpatterns = [
url(r'^edit_whitelist/(?P<whitelistid>[0-9]+)$',
views.edit_whitelist,
name='edit-whitelist'),
url(r'^del_whitelist/(?P<whitelistid>[0-9]+)$',
views.del_whitelist,
name='del-whitelist'),
url(r'^add_school/$', views.add_school, name='add-school'),
url(r'^edit_school/(?P<schoolid>[0-9]+)$',
views.edit_school,
......
......@@ -478,6 +478,23 @@ def edit_whitelist(request, whitelist_instance, **_kwargs):
)
@login_required
@can_delete(Whitelist)
def del_whitelist(request, whitelist, **_kwargs):
""" Supprime un acces gracieux"""
if request.method == "POST":
whitelist.delete()
messages.success(request, "L'accés gracieux a été supprimé")
return redirect(reverse(
'users:profil',
kwargs={'userid': str(whitelist.user.id)}
))
return form(
{'objet': whitelist, 'objet_name': 'whitelist'},
'users/delete.html',
request
)
@login_required
@can_create(School)
def add_school(request):
......
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