1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-22 12:34:17 +00:00

py-i2phosts-maint: fix rare situation with expires

If new calculated expires is in the past in relation to current
datetime, it was caused an exception.
This commit is contained in:
Hidden Z 2015-11-16 19:15:36 +00:00
parent 06468a3c7c
commit e6c301b379

View File

@ -91,6 +91,7 @@ for host in all_hosts:
if host.expires == None:
# workaround for situation when we updating expires first time
expires_current = datetime.datetime.utcnow().date()
host.expires = expires_current
else:
expires_current = host.expires
# calculate new expiration date