Clear filename when clear button is pressed
When the clear button of a binary field is pressed, you would expect the filename to be cleared too, but the associated field remains unchanged. issue2633 review16201002
This commit is contained in:
1 parent
77623908c9
commit
bcc5038e94
2 files changed
+5
-1
No files matched your search
@@ -129,6 +129,8 @@ class BinaryMixin(Widget):
|
||||
fp.write(self.field.get(self.record))
|
||||
|
||||
def clear(self, widget=None):
|
||||
if self.filename_field:
|
||||
self.filename_field.set_client(self.record, None)
|
||||
self.field.set_client(self.record, None)
|
||||
|
||||
|
||||
|
||||
@@ -501,7 +501,9 @@ class Binary(GenericText):
|
||||
|
||||
def clear_binary(self, renderer, path):
|
||||
record, field = self._get_record_field(path)
|
||||
field.set_client(record, False)
|
||||
if self.filename_field:
|
||||
self.filename_field.set_client(record, None)
|
||||
field.set_client(record, None)
|
||||
|
||||
|
||||
class Image(GenericText):
|
||||
|
||||
Reference in new issue
Block a user