Upgrade of Python+Django triggered AttributeError: 'list' object has no attribute 'strip'

It looks like, the culprit was in ProductAdminForm._build_dynamic_fields(self). It had a customization adding widget AdminSplitDateTime to attributes in type of date. It splits DateTimeField into a list of strings, and in a later step triggered exception in _clean_fields(self).

            elif datatype == attribute.TYPE_DATE:
                defaults.update({'widget': AdminSplitDateTime})

Quote an online resource:

@alias51 The value returned by the AdminSplitDateTime widget is a list . The DateTimeField expects the value to be a string and calls .split() , which gives you this exception. – [Daniel Hepper]

This widget worked OK in earlier versions of Python and Django though.

Thank you for your pateince and help, @KenWhitesell, especially your reminder to check _clean functions. Happy holidays.

1 Like