﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33679	"""empty"" suffix gets added to last (original) admin inline form row for readonly views"	Daniel Hahler	Daniel Hahler	"`django/contrib/admin/templates/admin/edit_inline/tabular.html` has the following code:

{{{
        <tr class=""form-row {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form{% endif %}""
             id=""{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}"">
}}}

The condition for adding the ""empty"" suffix to the id does not work when the object is readonly (no `has_add_permission`).

I think it should use the same condition as with the handling of the `empty-form` class.

The empty row gets added based on this in the first place: https://github.com/django/django/blob/f97401d1b184406d2e24f11eddbdaca8bbc360e3/django/contrib/admin/helpers.py#L299-L304

ref (added in): https://github.com/django/django/commit/825f0beda804e48e9197fcf3b0d909f9f548aa47#diff-3bed8380f4461efe8e7ec596937f85def59b1e38dcd6edd6e7f76c7a45d53f02"	Bug	closed	contrib.admin	4.0	Normal	fixed			Ready for checkin	1	0	0	0	0	0
