CDR Tickets

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
Description

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.

Comment entered 2019-02-21 13:25:55 by Kline, Bob (NIH/NCI) [C]

Here's a patch.

https://github.com/NCIOCPL/cdr-admin/commit/8fc53d25

diff --git a/Inetpub/wwwroot/cgi-bin/cdr/SummaryMailerReport.py b/Inetpub/wwwroot/cgi-bin/cdr/SummaryMailerReport.py
index 6dadba50..b7c1f86f 100644
--- 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:
     cdrcgi.bail('Database connection failure: %s' % e)
 
@@ -118,7 +119,7 @@ def makeBoardPicklist(cursor):
    WHERE s.path = '/Summary/SummaryMetaData/PDQBoard/Board/@cdr:ref'
      AND b.path = '/Organization/OrganizationNameInformation'
                 + '/OfficialName/Name'
-ORDER BY b.value""", timeout = 300)
+ORDER BY b.value""")
     html = [u"""\
 <select name='board'>
 """]
@@ -172,7 +173,7 @@ def report4258(sheet, styles, cursor, board, selectBy):
             ON b.doc_id = s.int_val
          WHERE r.path = '/Mailer/Recipient/@cdr:ref'
            AND s.path = '/Mailer/Document/@cdr:ref'
-           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):
            AND sent.path = '/Mailer/Sent'
            AND recip.path = '/Mailer/Recipient/@cdr:ref'
            AND sent.value BETWEEN '%s' AND '%s'""" %
-                   (begin, end), timeout = 300)
+                   (begin, end))
     mailerIds = []
     for mailerId, sent, personId in cursor.fetchall():
         if BoardMember.members[personId].membershipActive(sent):
Comment entered 2019-06-22 10:49:54 by Kline, Bob (NIH/NCI) [C]
Comment entered 2019-07-05 06:01:09 by Osei-Poku, William (NIH/NCI) [C]

Verified on DEV. Thanks!

Comment entered 2019-08-12 13:26:45 by Juthe, Robin (NIH/NCI) [E]

Verified on QA.

Comment entered 2019-08-27 12:30:40 by Juthe, Robin (NIH/NCI) [E]

Verified on PROD.

Elapsed: 0:00:00.001801