misc: fix HTML id used for file widgets in block of fields (#47925)

This commit is contained in:
Frédéric Péters 2020-10-21 15:12:58 +02:00
parent 13daba0c45
commit 3a8d270098
1 changed files with 2 additions and 1 deletions

View File

@ -209,7 +209,8 @@ StringWidget.render_content = string_render_content
def file_render_content(self):
attrs = {'id': 'form_' + str(self.name).split('$')[0]}
# remove trailing $file for identifier
attrs = {'id': 'form_' + str(self.name).rsplit('$', 1)[0]}
if self.required:
attrs['aria-required'] = 'true'
if self.attrs: