fix not being able to update delete_every when next_delete is null

This commit is contained in:
codl 2017-09-01 01:33:37 +02:00
parent 6056d1c28f
commit 8a8a7e593c
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 1 additions and 0 deletions

View File

@ -121,6 +121,7 @@ class Account(TimestampMixin, RemoteIDMixin):
if not (value == timedelta(0) or value >= timedelta(minutes=1)):
value = timedelta(minutes=1)
if key == 'policy_delete_every' and \
self.next_delete and\
datetime.now(timezone.utc) + value < self.next_delete:
# make sure that next delete is not in the far future
self.next_delete = datetime.now(timezone.utc) + value