diff --git a/CHANGES.md b/CHANGES.md index 39aeb3764..6d36986ee 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ Changelog 3.0.0b143 (unreleased) ---------------------- -- Nothing changed yet. +- Fix bug while swapping file in UploadNamedFileWidget 3.0.0b142 (2024-09-18) diff --git a/castle/cms/widgets.py b/castle/cms/widgets.py index deede71c1..69b396c26 100644 --- a/castle/cms/widgets.py +++ b/castle/cms/widgets.py @@ -829,6 +829,20 @@ class UploadNamedFileWidget(NamedFileWidget): klass = NamedFileWidget.klass + ' pat-upload-update' replacement = False + @property + def file_content_type(self): + try: + return super(UploadNamedFileWidget, self).file_content_type + except Exception: + return None + + @property + def file_icon(self): + try: + return super(UploadNamedFileWidget, self).file_icon + except Exception: + return None + @property def pattern_options(self): return json.dumps({