[binding] On gère aussi les dates avec des secondes.
This commit is contained in:
parent
3784c10da9
commit
db1dc7ec64
2 changed files with 23 additions and 17 deletions
|
@ -29,6 +29,7 @@ import secrets_new as secrets
|
|||
import ridtools
|
||||
|
||||
date_format = '%d/%m/%Y %H:%M'
|
||||
date_format_new = '%d/%m/%Y %H:%M:%S'
|
||||
hostname = gethostname().split(".")[0]
|
||||
smtpserv = "smtp.crans.org"
|
||||
random.seed() # On initialise le générateur aléatoire
|
||||
|
@ -2600,7 +2601,11 @@ class Adherent(BaseProprietaire):
|
|||
if self.historique():
|
||||
h = self.historique()[0]
|
||||
h = h[:h.find(",")]
|
||||
return time.mktime(time.strptime(h, date_format))
|
||||
try:
|
||||
dateInsc = time.mktime(time.strptime(h, date_format_new))
|
||||
except:
|
||||
dateInsc = time.mktime(time.strptime(h, date_format))
|
||||
return dateInsc
|
||||
else:
|
||||
# Lors de l'inscription d'un nouvel adhérent, celui-ci n'a pas
|
||||
# encore d'historique. On retourne alors la date en cours.
|
||||
|
|
|
@ -485,7 +485,7 @@ def adher_details(adher) :
|
|||
|
||||
# État administratif
|
||||
f += coul("Date d'inscription : ", "gras")
|
||||
f += strftime('%d/%m/%Y %H:%M', localtime(adher.dateInscription()))
|
||||
f += strftime('%d/%m/%Y %H:%M:%S', localtime(adher.dateInscription()))
|
||||
f += coul(u'\nÉtat administratif : ','gras')
|
||||
jour=1
|
||||
if ann_scol not in adher.carteEtudiant() :
|
||||
|
@ -1352,6 +1352,7 @@ if __name__ == '__main__' :
|
|||
cprint(u"""Une erreur fatale s'est produite durant l'exécution.
|
||||
Pour l'amélioration de ce programme merci de prévenir nounou en spécifiant la
|
||||
marche à suivre pour reproduire cette erreur.""")
|
||||
raise
|
||||
if debug :
|
||||
cprint('-'*40)
|
||||
cprint(u'Détails techniques :')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue