Spaces:
Runtime error
Runtime error
add messageID
Browse files
app.py
CHANGED
|
@@ -104,22 +104,26 @@ def save_data(orig_user_email, constituent_email, labels, user_response, current
|
|
| 104 |
person_id = 11029
|
| 105 |
|
| 106 |
try:
|
| 107 |
-
|
| 108 |
if orig_user_email != "":
|
| 109 |
db_cursor.execute(
|
| 110 |
"INSERT INTO radmap_frog12.messages (app_id, org_id, person_id, communication_method_id, status_id, subject, body, send_date, message_type, volley) VALUES (345678, %s, %s, 1, 1, 'Email Classification and Response Tracking', %s, NOW(), 'Email Classification and Response Tracking', %s)",
|
| 111 |
-
(ORG_ID, person_id, orig_user_email,
|
| 112 |
)
|
| 113 |
-
|
|
|
|
|
|
|
| 114 |
|
| 115 |
db_cursor.execute(
|
| 116 |
"INSERT INTO radmap_frog12.messages (app_id, org_id, person_id, communication_method_id, status_id, subject, body, send_date, message_type, volley) VALUES (345678, %s, 0, 1, 1, 'Email Classification and Response Tracking', %s, NOW(), 'Email Classification and Response Tracking', %s)",
|
| 117 |
-
(ORG_ID, constituent_email,
|
| 118 |
)
|
| 119 |
|
|
|
|
|
|
|
| 120 |
db_cursor.execute(
|
| 121 |
"INSERT INTO radmap_frog12.messages (app_id, org_id, person_id, communication_method_id, status_id, subject, body, send_date, message_type, volley) VALUES (345678, %s, %s, 1, 1, 'Email Classification and Response Tracking', %s, NOW(), 'Email Classification and Response Tracking', %s)",
|
| 122 |
-
(ORG_ID, person_id, user_response,
|
| 123 |
)
|
| 124 |
|
| 125 |
# insert a row into the message_categorys_associations table for each valid label in labels with the message_id of the constituent_email
|
|
|
|
| 104 |
person_id = 11029
|
| 105 |
|
| 106 |
try:
|
| 107 |
+
message_id = 0
|
| 108 |
if orig_user_email != "":
|
| 109 |
db_cursor.execute(
|
| 110 |
"INSERT INTO radmap_frog12.messages (app_id, org_id, person_id, communication_method_id, status_id, subject, body, send_date, message_type, volley) VALUES (345678, %s, %s, 1, 1, 'Email Classification and Response Tracking', %s, NOW(), 'Email Classification and Response Tracking', %s)",
|
| 111 |
+
(ORG_ID, person_id, orig_user_email, message_id),
|
| 112 |
)
|
| 113 |
+
|
| 114 |
+
#
|
| 115 |
+
message_id = db_cursor.lastrowid
|
| 116 |
|
| 117 |
db_cursor.execute(
|
| 118 |
"INSERT INTO radmap_frog12.messages (app_id, org_id, person_id, communication_method_id, status_id, subject, body, send_date, message_type, volley) VALUES (345678, %s, 0, 1, 1, 'Email Classification and Response Tracking', %s, NOW(), 'Email Classification and Response Tracking', %s)",
|
| 119 |
+
(ORG_ID, constituent_email, message_id),
|
| 120 |
)
|
| 121 |
|
| 122 |
+
message_id = db_cursor.lastrowid
|
| 123 |
+
|
| 124 |
db_cursor.execute(
|
| 125 |
"INSERT INTO radmap_frog12.messages (app_id, org_id, person_id, communication_method_id, status_id, subject, body, send_date, message_type, volley) VALUES (345678, %s, %s, 1, 1, 'Email Classification and Response Tracking', %s, NOW(), 'Email Classification and Response Tracking', %s)",
|
| 126 |
+
(ORG_ID, person_id, user_response, message_id),
|
| 127 |
)
|
| 128 |
|
| 129 |
# insert a row into the message_categorys_associations table for each valid label in labels with the message_id of the constituent_email
|