From 51b9ce1f8f8e738206973b11ce850d9016ceffee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 24 Nov 2011 09:58:37 +0100 Subject: [PATCH] do not force end time if it's not defined --- tabellio/pcfdb/sync.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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)