Remove document model cache invalidation
The cache invalidation is now handled by the file caching app. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -139,6 +139,7 @@ class DocumentVersion(models.Model):
|
||||
page.delete()
|
||||
|
||||
self.file.storage.delete(self.file.name)
|
||||
self.cache_partition.delete()
|
||||
|
||||
return super(DocumentVersion, self).delete(*args, **kwargs)
|
||||
|
||||
@@ -225,11 +226,6 @@ class DocumentVersion(models.Model):
|
||||
return (self.checksum, self.document.natural_key())
|
||||
natural_key.dependencies = ['documents.Document']
|
||||
|
||||
def invalidate_cache(self):
|
||||
self.cache_partition.purge()
|
||||
for page in self.pages.all():
|
||||
page.invalidate_cache()
|
||||
|
||||
@property
|
||||
def is_in_trash(self):
|
||||
return self.document.is_in_trash
|
||||
|
||||
Reference in New Issue
Block a user