Skip to content

Commit

Permalink
Fix bug while swapping file in UploadNamedFileWidget (#610)
Browse files Browse the repository at this point in the history
* Fix bug while swapping file in UploadNamedFileWidget

* fix spacing
  • Loading branch information
bduncan137 authored Sep 19, 2024
1 parent 4859071 commit fb4059d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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

0 comments on commit fb4059d

Please sign in to comment.