Fixed #30243 -- Simplified ModelAdmin.render_change_form()'s has_file_field.

This commit is contained in:
btknu 2019-03-09 00:03:58 +01:00 committed by Tim Graham
parent 7c68cea7ee
commit 7c3a8b9db2
1 changed files with 1 additions and 1 deletions

View File

@ -1125,7 +1125,7 @@ class ModelAdmin(BaseModelAdmin):
'has_delete_permission': self.has_delete_permission(request, obj),
'has_editable_inline_admin_formsets': has_editable_inline_admin_formsets,
'has_file_field': context['adminform'].form.is_multipart() or any(
admin_formset.formset.form().is_multipart()
admin_formset.formset.is_multipart()
for admin_formset in context['inline_admin_formsets']
),
'has_absolute_url': view_on_site_url is not None,