kopia lustrzana https://github.com/wagtail/wagtail
Added missing is_stored_locally() to AbstractDocument
rodzic
7a47bfc9a7
commit
851bd5f24d
|
@ -63,6 +63,7 @@ Changelog
|
|||
* Fix: Page.copy() no longer copies child objects when the accesssor name is included in `exclude_fields_in_copy` (Karl Hobley)
|
||||
* Fix: Move focus to the pages explorer menu when open (Helen Chapman)
|
||||
* Fix: Clicking the privacy toggle while the page is still loading no longer loads the wrong data in the page (Helen Chapman)
|
||||
* Fix: Added missing `is_stored_locally` method to `AbstractDocument` (jonny5532)
|
||||
|
||||
|
||||
2.5.1 (07.05.2019)
|
||||
|
|
|
@ -380,6 +380,7 @@ Contributors
|
|||
* Jordan Bauer
|
||||
* Fidel Ramos
|
||||
* Quadric
|
||||
* jonny5532
|
||||
|
||||
Translators
|
||||
===========
|
||||
|
|
|
@ -94,6 +94,7 @@ Bug fixes
|
|||
* Added missing form media to user edit form template (Matt Westcott)
|
||||
* ``Page.copy()`` no longer copies child objects when the accesssor name is included in ``exclude_fields_in_copy`` (Karl Hobley)
|
||||
* Clicking the privacy toggle while the page is still loading no longer loads the wrong data in the page (Helen Chapman)
|
||||
* Added missing ``is_stored_locally`` method to ``AbstractDocument`` (jonny5532)
|
||||
|
||||
|
||||
Upgrade considerations
|
||||
|
|
|
@ -52,6 +52,17 @@ class AbstractDocument(CollectionMember, index.Indexed, models.Model):
|
|||
index.FilterField('uploaded_by_user'),
|
||||
]
|
||||
|
||||
def is_stored_locally(self):
|
||||
"""
|
||||
Returns True if the image is hosted on the local filesystem
|
||||
"""
|
||||
try:
|
||||
self.file.path
|
||||
|
||||
return True
|
||||
except NotImplementedError:
|
||||
return False
|
||||
|
||||
@contextmanager
|
||||
def open_file(self):
|
||||
# Open file if it is closed
|
||||
|
|
Ładowanie…
Reference in New Issue