Pas de deco du scheduler pour les admins reseau (responsablereseau)

This commit is contained in:
Bryce Tichit 2014-08-12 19:36:06 +02:00
parent 29ae32e0be
commit aa559459c8
2 changed files with 6 additions and 2 deletions

View File

@ -23,7 +23,7 @@ def admin_user():
sched = Scheduler()
def disconnect_members_from_residence(admin_user, residence_dn):
members = Member.get_all(admin_user, residence_dn)
members = Member.get_all_non_admin(admin_user, residence_dn)
print (CotisationComputes.current_year())
for member in members:

View File

@ -37,9 +37,13 @@ class Member(object):
@staticmethod
def get_all(user_session, residence_dn):
return user_session.ldap_bind.search(ldap_config.username_base_dn + residence_dn, "(objectClass=pacatnetMember)")
return user_session.ldap_bind.search(ldap_config.username_base_dn + residence_dn, "(objectClass=pacatnetMember)")
#end def
@staticmethod
def get_all_non_admin(user_session, residence_dn):
return user_session.ldap_bind.search(ldap_config.username_base_dn + residence_dn, "(&(objectClass=pacatnetMember)(!(memberof=cn=responsablereseau,ou=groupes,"+residence_dn+")))")
@staticmethod
def get_all_with_machines_and_cotisations(user_session, residence_dn):
return user_session.ldap_bind.get_childs(ldap_config.username_base_dn + residence_dn)