Skip to content

Commit a9c5fd9

Browse files
committed
fix: cae1bbf2536b - expression errors not setting result properly
Rather than setting 'result' in renderContext, I was wrirting the output directly, but was stil falling through to where result would be used. This caused email to be sent to the admin and when test_mailgw was called the mail-test.log was somehow created and caused the test there to fail. Fixed renderContext to use result variable and output contents of mail-test.log to make debugging easier. This should fix CI failure.
1 parent 283608f commit a9c5fd9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

roundup/cgi/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,7 @@ def renderContext(self):
22332233
except ExpressionError as e:
22342234
self.add_error_message(str(e))
22352235
self.template = "search"
2236-
self.write_html(self.renderContext())
2236+
result = self.renderContext()
22372237

22382238
if 'Content-Type' not in self.additional_headers:
22392239
self.additional_headers['Content-Type'] = pt.content_type

test/test_mailgw.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ def testAlternateAddress(self):
539539
This is a test submission of a new issue.
540540
''')
541541
userlist = self.db.user.list()
542+
if os.path.exists(SENDMAILDEBUG):
543+
with open(SENDMAILDEBUG) as f:
544+
print(f.read())
542545
assert not os.path.exists(SENDMAILDEBUG)
543546
self.assertEqual(userlist, self.db.user.list(),
544547
"user created when it shouldn't have been")

0 commit comments

Comments
 (0)