summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2011-11-24 08:58:37 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2011-11-24 08:58:37 (GMT)
commit51b9ce1f8f8e738206973b11ce850d9016ceffee (patch)
treece61f54fa2f1f0127b0c14f697873569fee05869
parent94ba9733d1a732eff9b157607edea46dc7932513 (diff)
downloadtabellio.pcfdb-51b9ce1f8f8e738206973b11ce850d9016ceffee.zip
tabellio.pcfdb-51b9ce1f8f8e738206973b11ce850d9016ceffee.tar.gz
tabellio.pcfdb-51b9ce1f8f8e738206973b11ce850d9016ceffee.tar.bz2
do not force end time if it's not defined
-rw-r--r--tabellio/pcfdb/sync.py8
1 files 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)