﻿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
33669	cell_count filter crashes if field_data is a dictionary	Reza Zeiny	nobody	"I have a bug in function cell_count in file django/contrib/admin/templatetags/admin_modify.py

please check type of field_data if this is dictionary this can not call with dot.

I fixed it and over write in my code. my code is:
{{{

@register.filter
def cell_count(inline_admin_form):
    """"""Return the number of cells used in a tabular inline.""""""
    count = 1  # Hidden cell with hidden 'id' field
    for fieldset in inline_admin_form:
        # Count all visible fields.
        for line in fieldset:
            for field in line:
                field_data = field.field
                if type(field_data) == dict:
                    is_hidden = field_data[""is_hidden""]
                else:
                    is_hidden = field_data.is_hidden
                if not is_hidden:
                    count += 1
    if inline_admin_form.formset.can_delete:
        # Delete checkbox
        count += 1
    return count
}}}
"	Bug	closed	contrib.admin	4.0	Normal	duplicate		rezazeiny1998@…	Unreviewed	0	0	0	0	0	0
