templates: search custom template for simple widgets only (#56252)
This commit is contained in:
parent
6bf6be86e0
commit
e50ab0dfe1
|
@ -124,7 +124,10 @@ def with_template(form):
|
|||
form_template = template.loader.get_template('gadjo/form.html')
|
||||
fields_with_templates = []
|
||||
for field in form:
|
||||
templates = ['gadjo/%s-widget.html' % field.field.widget.input_type, 'gadjo/widget.html']
|
||||
widget = field.field.widget
|
||||
templates = ['gadjo/widget.html']
|
||||
if hasattr(widget, 'input_type'):
|
||||
templates.insert(0, 'gadjo/%s-widget.html' % widget.input_type)
|
||||
fields_with_templates.append(
|
||||
(
|
||||
field,
|
||||
|
|
Loading…
Reference in New Issue