#14363 closed (fixed)
ManyToManyRawIdWidget.render is assuming `attrs` is always passed as a dict.
Reported by: | Germano Gabbianelli | Owned by: | Jannis Leidel |
---|---|---|---|
Component: | contrib.admin | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
def render(self, name, value, attrs=None): attrs['class'] = 'vManyToManyRawIdAdminField' if value: value = ','.join([force_unicode(v) for v in value]) else: value = '' return super(ManyToManyRawIdWidget, self).render(name, value, attrs)
Either if I pass something else than a dict-like object or if I don't pass nothing at all, the method will raise an exception.
Attachments (2)
Change History (6)
by , 14 years ago
Attachment: | patch.diff added |
---|
comment:1 by , 14 years ago
Status: | new → assigned |
---|---|
Triage Stage: | Unreviewed → Accepted |
by , 14 years ago
Attachment: | fix-None-attrs-with-tests.diff added |
---|
comment:2 by , 14 years ago
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 by , 14 years ago
Note:
See TracTickets
for help on using tickets.
I've added some tests to the original patch.
I've also adjusted a couple of indentation issues that seemed to be in the same area of tests :)