From 27e5180e237f5bdbd9674e72b6538e3013d51692 Mon Sep 17 00:00:00 2001 From: chirac Date: Mon, 24 Oct 2016 01:28:11 +0200 Subject: [PATCH] Diverses erreurs --- machines/models.py | 4 ++-- users/models.py | 4 ++-- users/views.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/machines/models.py b/machines/models.py index b764edfc..5d2fa8e5 100644 --- a/machines/models.py +++ b/machines/models.py @@ -65,9 +65,9 @@ class IpList(models.Model): @receiver(post_save, sender=Interface) def interface_post_save(sender, **kwargs): user = kwargs['instance'].machine.user - user.ldap_sync(base=False, access_refresh=False, mac_refresh=True) + #user.ldap_sync(base=False, access_refresh=False, mac_refresh=True) @receiver(post_delete, sender=Interface) def interface_post_delete(sender, **kwargs): user = kwargs['instance'].machine.user - user.ldap_sync(base=False, access_refresh=False, mac_refresh=True) + #user.ldap_sync(base=False, access_refresh=False, mac_refresh=True) diff --git a/users/models.py b/users/models.py index d5952771..ea06fd37 100644 --- a/users/models.py +++ b/users/models.py @@ -496,8 +496,8 @@ class LdapServiceUser(ldapdb.models.Model): class BaseInfoForm(ModelForm): def __init__(self, *args, **kwargs): super(BaseInfoForm, self).__init__(*args, **kwargs) - self.fields['name'].label = 'Nom' - self.fields['surname'].label = 'Prénom' + self.fields['name'].label = 'Prénom' + self.fields['surname'].label = 'Nom' self.fields['school'].label = 'Établissement' self.fields['comment'].label = 'Commentaire' self.fields['room'].label = 'Chambre' diff --git a/users/views.py b/users/views.py index 145d18f2..279d2868 100644 --- a/users/views.py +++ b/users/views.py @@ -130,7 +130,7 @@ def state(request, userid): state = StateForm(request.POST or None, instance=user) if state.is_valid(): if state.has_changed(): - if state.cleaned_data['state'] == User.STATE_ARCHIVED: + if state.cleaned_data['state'] == User.STATE_ARCHIVE: archive(user) else: unarchive(user) @@ -251,7 +251,7 @@ def add_whitelist(request, userid): reversion.set_comment("Création") messages.success(request, "Accès à titre gracieux accordé") return redirect("/users/profil/" + userid) - if is_whitelisted(user): + if user.is_whitelisted(): messages.error( request, "Attention, cet utilisateur a deja un accès gracieux actif"