Return False for the document's exists() method when it doesn't have
a document version. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -237,7 +237,11 @@ class Document(models.Model):
|
||||
Returns a boolean value that indicates if the document's
|
||||
latest version file exists in storage
|
||||
"""
|
||||
return self.latest_version.exists()
|
||||
latest_version = self.latest_version
|
||||
if latest_version:
|
||||
return latest_version.exists()
|
||||
else:
|
||||
return False
|
||||
|
||||
def invalidate_cache(self):
|
||||
for document_version in self.versions.all():
|
||||
|
||||
Reference in New Issue
Block a user