Browse Source

py-i2phosts-maint: add workaround for situation when we updating expires first time

pull/1/head
Hidden Z 14 years ago
parent
commit
9a6cc81403
  1. 4
      py-i2phosts-maint

4
py-i2phosts-maint

@ -57,6 +57,10 @@ for host in all_hosts: @@ -57,6 +57,10 @@ for host in all_hosts:
else:
timedelta = datetime.timedelta(days=60)
# get current host expiration date from database
if host.expires == None:
# workaround for situation when we updating expires first time
expires_current = datetime.datetime.now().date()
else:
expires_current = host.expires
# calculate new expiration date
expires_new = host.last_seen + timedelta

Loading…
Cancel
Save