mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-14 10:13:13 +00:00
Chooser widgets should be considered is_hidden=False
This commit is contained in:
parent
73dee9898c
commit
9efa3af564
2 changed files with 8 additions and 0 deletions
|
|
@ -18,6 +18,10 @@ class TestAdminPageChooserWidget(TestCase):
|
|||
)
|
||||
self.root_page.add_child(instance=self.child_page)
|
||||
|
||||
def test_not_hidden(self):
|
||||
widget = widgets.AdminPageChooser()
|
||||
self.assertFalse(widget.is_hidden)
|
||||
|
||||
def test_render_html(self):
|
||||
widget = widgets.AdminPageChooser()
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,10 @@ class AdminChooser(WidgetWithScript, widgets.Input):
|
|||
link_to_chosen_text = _("Edit this item")
|
||||
show_edit_link = True
|
||||
|
||||
# when looping over form fields, this one should appear in visible_fields, not hidden_fields
|
||||
# despite the underlying input being type="hidden"
|
||||
is_hidden = False
|
||||
|
||||
def get_instance(self, model_class, value):
|
||||
# helper method for cleanly turning 'value' into an instance object
|
||||
if value is None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue