Skip to content

Commit

Permalink
Only mangle LinkField.text if the user supplies a $ char.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed May 27, 2012
1 parent 13e6ee5 commit c489fb8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tw2/forms/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ def prepare(self):
super(LinkField, self).prepare()
self.safe_modify('attrs')
self.attrs['href'] = self.link.replace('$', unicode(self.value or ''))
self.text = \
self.value and \
self.text.replace('$', unicode(self.value)) or \
''

if '$' in self.text:
self.text = \
self.value and \
self.text.replace('$', unicode(self.value)) or \
''


class Button(InputField):
Expand Down

0 comments on commit c489fb8

Please sign in to comment.