Issue Number | 4575 |
---|---|
Summary | [Summaries] Summary Mailer History Report Generates Python Error |
Created | 2019-02-21 13:00:10 |
Issue Type | Bug |
Submitted By | Juthe, Robin (NIH/NCI) [E] |
Assigned To | Kline, Bob (NIH/NCI) [C] |
Status | Closed |
Resolved | 2019-06-22 10:49:54 |
Resolution | Fixed |
Path | /home/bkline/backups/jira/ocecdr/issue.240501 |
The Summary Mailer History report is currently generating a python error.
Here's an example of one of the error messages I received:
A problem occurred in a Python script.
D:\cdr\Log\tmpfufmip.html contains the description of this error.
Here's a patch.
https://github.com/NCIOCPL/cdr-admin/commit/8fc53d25
--git a/Inetpub/wwwroot/cgi-bin/cdr/SummaryMailerReport.py b/Inetpub/wwwroot/cgi-bin/cdr/SummaryMailerReport.py
diff 6dadba50..b7c1f86f 100644
index --- a/Inetpub/wwwroot/cgi-bin/cdr/SummaryMailerReport.py
+++ b/Inetpub/wwwroot/cgi-bin/cdr/SummaryMailerReport.py
@@ -31,8 +31,9 @@
# Request form for generating RTF letters to board members."
#
#----------------------------------------------------------------------
-import cgi, cdr, cdrdb, cdrcgi, time
+import cgi, cdr, cdrcgi, time
import lxml.etree as etree
+from cdrapi import db as cdrdb
#----------------------------------------------------------------------
# Set the form variables.
@@ -102,7 +103,7 @@ if flavor not in ("4258", "4259"):
# Connect to the CDR database.
#----------------------------------------------------------------------
try:
- conn = cdrdb.connect('CdrGuest')
+ conn = cdrdb.connect(user='CdrGuest', timeout=300)
except Exception, e:
'Database connection failure: %s' % e)
cdrcgi.bail(
@@ -118,7 +119,7 @@ def makeBoardPicklist(cursor):
= '/Summary/SummaryMetaData/PDQBoard/Board/@cdr:ref'
WHERE s.path = '/Organization/OrganizationNameInformation'
AND b.path + '/OfficialName/Name'
-ORDER BY b.value""", timeout = 300)
+ORDER BY b.value""")
= [u"""\
html <select name='board'>
"""]
@@ -172,7 +173,7 @@ def report4258(sheet, styles, cursor, board, selectBy):
= s.int_val
ON b.doc_id = '/Mailer/Recipient/@cdr:ref'
WHERE r.path = '/Mailer/Document/@cdr:ref'
AND s.path - AND d.path = '/Mailer/%s'""" % dateField, timeout = 300)
+ AND d.path = '/Mailer/%s'""" % dateField)
= {}
mailers for m, r, s, d in cursor.fetchall():
if d and BoardMember.members[r].membershipActive(d):
@@ -205,7 +206,7 @@ def report4259(sheet, styles, cursor, board, begin, end):
= '/Mailer/Sent'
AND sent.path = '/Mailer/Recipient/@cdr:ref'
AND recip.path '%s' AND '%s'""" %
AND sent.value BETWEEN - (begin, end), timeout = 300)
+ (begin, end))
mailerIds = []
for mailerId, sent, personId in cursor.fetchall():
if BoardMember.members[personId].membershipActive(sent):
Fixed on DEV.
Verified on DEV. Thanks!
Verified on QA.
Verified on PROD.
Elapsed: 0:00:00.001801