# HG changeset patch # User Laura Médioni # Date 1434034311 -7200 # Node ID b0417cacecd9af73e8c5ce48f5dc93f26eb5460d # Parent ad0615d4500d110dabbf7d2d7e7735ab4c502a54 [web] write css_class to attrs on rendering and not on button creation Because css_class attribute may be overriden by bootstrap after button creation and this modification has to be taken into account. closes #5457548 diff -r ad0615d4500d -r b0417cacecd9 web/formwidgets.py --- a/web/formwidgets.py Tue May 06 10:28:23 2014 +0200 +++ b/web/formwidgets.py Thu Jun 11 16:51:51 2015 +0200 @@ -1040,11 +1040,11 @@ self.value = '' self.onclick = onclick self.cwaction = cwaction - self.attrs.setdefault('class', self.css_class) def render(self, form, field=None, renderer=None): label = form._cw._(self.label) attrs = self.attrs.copy() + attrs.setdefault('class', self.css_class) if self.cwaction: assert self.onclick is None attrs['onclick'] = "postForm('__action_%s', \'%s\', \'%s\')" % (