Utilise les nouvelles variables de config et fonctions de crans_utils
This commit is contained in:
parent
6ae6e54101
commit
955dd379c7
3 changed files with 13 additions and 13 deletions
|
@ -18,11 +18,10 @@ import re
|
|||
|
||||
import affichage
|
||||
import lc_ldap.shortcuts
|
||||
from lc_ldap.crans_utils import to_generalized_time_format as to_gtf
|
||||
|
||||
import mail as mail_module
|
||||
from config import demenagement_delai as delai, \
|
||||
debut_periode_transitoire, periode_transitoire
|
||||
gtf_debut_periode_transitoire, periode_transitoire
|
||||
|
||||
ERASE_DAY = { 'second': 0, 'minute': 0, 'microsecond': 0, 'hour': 0, }
|
||||
DAY = datetime.timedelta(days=1)
|
||||
|
@ -113,7 +112,7 @@ if __name__ == '__main__':
|
|||
conn = lc_ldap.shortcuts.lc_ldap_admin()
|
||||
|
||||
if periode_transitoire:
|
||||
date = to_gtf(debut_periode_transitoire)
|
||||
date = gtf_debut_periode_transitoire
|
||||
else:
|
||||
date = now.strftime(FORMAT_LDAP) + 'Z'
|
||||
|
||||
|
|
|
@ -12,15 +12,16 @@ import calendar
|
|||
|
||||
from lc_ldap.shortcuts import lc_ldap_readonly
|
||||
from lc_ldap.variables import base_dn
|
||||
from lc_ldap import crans_utils
|
||||
import ldap
|
||||
from affich_tools import coul
|
||||
import gestion.mail as mail_module
|
||||
import gestion.config as config
|
||||
|
||||
PERIODE_TRANSITOIRE = [
|
||||
datetime.datetime.utcfromtimestamp(date).replace(tzinfo=pytz.UTC)
|
||||
crans_utils.datetime_from_generalized_time_format(date)
|
||||
for date in
|
||||
[config.debut_periode_transitoire, config.fin_periode_transitoire]
|
||||
[config.gtf_debut_periode_transitoire, config.gtf_fin_periode_transitoire]
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ def adherents(regen=False):
|
|||
adhérents"""
|
||||
|
||||
if regen or not adherents.data:
|
||||
adherents.data = DB.search(u'(&(debutAdhesion>=%s)(aid=*))' % (crans_utils.to_generalized_time_format(config.debut_periode_transitoire)), sizelimit=2000)
|
||||
adherents.data = DB.search(u'(&(debutAdhesion>=%s)(aid=*))' % (config.gtf_debut_periode_transitoire,), sizelimit=2000)
|
||||
return list(adherents.data)
|
||||
|
||||
@static_var(("data", []))
|
||||
|
@ -59,7 +59,7 @@ def factures(regen=False):
|
|||
|
||||
if regen or not factures.data:
|
||||
factures.data = DB.search(u'(&(|(debutAdhesion>=%(now)s)(debutConnexion>=%(now)s))(fid=*))' % {
|
||||
'now': crans_utils.to_generalized_time_format(config.debut_periode_transitoire),
|
||||
'now': config.gtf_debut_periode_transitoire,
|
||||
}, sizelimit=0)
|
||||
return list(factures.data)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue