8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-25 22:03:10 +00:00

Diverses erreurs

This commit is contained in:
chirac 2016-10-24 01:28:11 +02:00
parent 99724e91e2
commit 27e5180e23
3 changed files with 6 additions and 6 deletions

View file

@ -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)

View file

@ -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'

View file

@ -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"