diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py index 77c66c5..9979d7e 100644 --- a/tabellio/pcfdb/sync.py +++ b/tabellio/pcfdb/sync.py @@ -1162,14 +1162,12 @@ class SyncFromPcfDbView(BrowserView): object.end = datetime.datetime.strptime( '%s %s' % (datefin, heurefin), '%Y-%m-%d %H:%M:%S') - else: - object.end = datetime.datetime.strptime( + elif datedeb != datefin: + object.end = datetime.datetime.strptime( '%s' % datefin, '%Y-%m-%d') - if object.end < object.start: - object.end = object.start if state == 'S_OPEN' and type == 'SE' and datefin and not finreel: - if object.end < datetime.datetime.now(): + if object.end and object.end < datetime.datetime.now(): # seances still open, with no real end date, but an end date # that's already in the past, alter the end date. object.end = object.end + datetime.timedelta(seconds=600)