Commit b75671cc by Guba Sándor

storage: removed timedelta from is_deletable

parent 67324baa
...@@ -11,7 +11,6 @@ from django.utils import timezone ...@@ -11,7 +11,6 @@ from django.utils import timezone
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from sizefield.models import FileSizeField from sizefield.models import FileSizeField
from datetime import timedelta
from acl.models import AclBase from acl.models import AclBase
from .tasks import local_tasks, remote_tasks from .tasks import local_tasks, remote_tasks
...@@ -173,9 +172,7 @@ class Disk(AclBase, TimeStampedModel): ...@@ -173,9 +172,7 @@ class Disk(AclBase, TimeStampedModel):
"""True if the associated file can be deleted. """True if the associated file can be deleted.
""" """
# Check if all children and the disk itself is destroyed. # Check if all children and the disk itself is destroyed.
yesterday = timezone.now() - timedelta(days=1) return (self.destroyed is not None) and self.children_deletable
return (self.destroyed is not None
and self.destroyed < yesterday) and self.children_deletable
@property @property
def children_deletable(self): def children_deletable(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment