Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug while swapping file in UploadNamedFileWidget #610

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 14 additions & 0 deletions castle/cms/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Loading