Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#9216 closed Uncategorized (wontfix)

Forms: Assert that js and css attributes of Media contain list or tuple

Reported by: Thomas Güttler Owned by: nobody
Component: Forms Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no



this patch checks if the attributes js and css of the Media class contain a list or tuple, and not
a string.

Test included.

Attachments (1)

widget_assert_list_or_tuple.diff (2.0 KB) - added by Thomas Güttler 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Thomas Güttler

comment:1 Changed 8 years ago by Jacob

Resolution: wontfix
Status: newclosed

isinstance() checks are not good Python -- any iterable should work for js, for example -- and this check isn't needed. If someone uses a bad type, they'll get an error. That's how Python works.

comment:2 Changed 8 years ago by Thomas Güttler

Strings are iterable. But if you use a string, you won't get the expected result.

A patch like this would make django more friendly for people with little experience.

Maybe I should have done it different: Check if the object is iterable, but is not a string.

comment:3 Changed 5 years ago by Thomas Güttler

Cc: hv@… removed
Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset
Note: See TracTickets for help on using tickets.
Back to Top