Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 5182:dc657fbbc790
- issue2550933 - Fix Traceback in cgi/templating.py when a string is
passed to PasswordHTMLProperty::plain. (John Rouillard)
This is a more pythonic patch than presented in the issue. Try the
original code and if it fails take alternative action.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 11 Feb 2017 17:20:47 -0500 |
| parents | f95650727b1c |
| children | 5c8808f55d93 |
comparison
equal
deleted
inserted
replaced
| 5180:f95650727b1c | 5182:dc657fbbc790 |
|---|---|
| 1552 if not self.is_view_ok(): | 1552 if not self.is_view_ok(): |
| 1553 return self._('[hidden]') | 1553 return self._('[hidden]') |
| 1554 | 1554 |
| 1555 if self._value is None: | 1555 if self._value is None: |
| 1556 return '' | 1556 return '' |
| 1557 value = self._value.dummystr() | 1557 try: |
| 1558 value = self._value.dummystr() | |
| 1559 except AttributeError: | |
| 1560 value = self._('[hidden]') | |
| 1558 if escape: | 1561 if escape: |
| 1559 value = cgi.escape(value) | 1562 value = cgi.escape(value) |
| 1560 return value | 1563 return value |
| 1561 | 1564 |
| 1562 def field(self, size=30, **kwargs): | 1565 def field(self, size=30, **kwargs): |
