Fixed old Milkforbid

This commit is contained in:
2020-06-08 23:35:05 +02:00
parent 82abe16cca
commit 164d6990df

View File

@@ -188,15 +188,17 @@ class ADIS:
animalnr, earmark, rfid, forbidmilk, tsforbidstart, tsforbidend = animalinfo
#Check milking forbidden
milkforbid = 0
if forbidmilk and tsforbidstart:
dttsforbidstart = datetime.strptime (tsforbidstart + ' 00:00:00', '%Y-%m-%d %H:%M:%S')
if datetime.now () > dttsforbidstart:
if tsforbidend:
dttsforbidend = datetime.strptime (tsforbidend + ' 23:59:59', '%Y-%m-%d %H:%M:%S')
if datetime.now () <= dttsforbidend:
milkforbid = 1
else:
milkforbid = 1
if forbidmilk:
milkforbid = 1
#if forbidmilk and tsforbidstart:
# dttsforbidstart = datetime.strptime (tsforbidstart + ' 00:00:00', '%Y-%m-%d %H:%M:%S')
# if datetime.now () > dttsforbidstart:
# if tsforbidend:
# dttsforbidend = datetime.strptime (tsforbidend + ' 23:59:59', '%Y-%m-%d %H:%M:%S')
# if datetime.now () <= dttsforbidend:
# milkforbid = 1
# else:
# milkforbid = 1
retval = ""
for ammount, time, mdate, starttime in milkdata: