Skip to content

Commit e934a68

Browse files
committed
- 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.
1 parent 5f54b1e commit e934a68

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ Fixed:
349349
- Fix Traceback in backends/portalocker.py on windows due to missing
350350
windll import, thanks to Heiko Stegmann for suggesting a first fix.
351351
(Ralf Schlatterbeck)
352-
352+
- issue2550933 - Fix Traceback in cgi/templating.py when a string is
353+
passed to PasswordHTMLProperty::plain. (John Rouillard)
353354

354355
2016-01-11: 1.5.1
355356

roundup/cgi/templating.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,10 @@ def plain(self, escape=0):
15541554

15551555
if self._value is None:
15561556
return ''
1557-
value = self._value.dummystr()
1557+
try:
1558+
value = self._value.dummystr()
1559+
except AttributeError:
1560+
value = self._('[hidden]')
15581561
if escape:
15591562
value = cgi.escape(value)
15601563
return value

0 commit comments

Comments
 (0)