Les timestamps c'est merdique, maintenant tout est du datetime
This commit is contained in:
parent
4de62cd0a8
commit
a1f27f9f1a
3 changed files with 64 additions and 43 deletions
|
@ -267,25 +267,31 @@ def list_clubs(clubs, width=None):
|
|||
)
|
||||
|
||||
def proprio(proprio, params):
|
||||
params['o']=proprio
|
||||
etat_administratif=[]
|
||||
_now = crans_utils.localized_datetime()
|
||||
params['o'] = proprio
|
||||
etat_administratif = []
|
||||
|
||||
if proprio.paiement_ok():
|
||||
etat_administratif.append(style(u"à jour", "vert"))
|
||||
|
||||
if not proprio.paiement_ok():
|
||||
etat_administratif.append(style(u"cotisation non réglée", "violet"))
|
||||
if proprio.fin_adhesion() >= time.time():
|
||||
|
||||
if proprio.fin_adhesion() >= _now:
|
||||
adh = style(u"Adhésion jusqu'au %s" % (time.strftime("%d/%m/%Y %H:%M:%S", time.localtime(proprio.fin_adhesion())),), "vert")
|
||||
elif proprio.paiement_ok():
|
||||
adh = style(u"Adhésion terminée, mais il y a un sursis.", 'orange')
|
||||
else:
|
||||
adh = style(u"Pas adhérent actuellement.", 'rouge')
|
||||
|
||||
params["adh"] = adh
|
||||
if proprio.fin_connexion() >= time.time():
|
||||
if proprio.fin_connexion() >= _now:
|
||||
conn = style(u"Connexion jusqu'au %s" % (time.strftime("%d/%m/%Y %H:%M:%S", time.localtime(proprio.fin_connexion())),), "vert")
|
||||
elif proprio.paiement_ok():
|
||||
conn = style(u"Connexion terminée, mais il y a un sursis.", 'orange')
|
||||
else:
|
||||
conn = style(u"Pas connecté actuellement.", 'rouge')
|
||||
|
||||
params["conn"] = conn
|
||||
params['etat_administratif'] = etat_administratif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue