AMead10 commited on
Commit
53a68f0
·
1 Parent(s): 27eb4fe

add messageID

Browse files
Files changed (1) hide show
  1. app.py +9 -5
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
- volley = 1
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, volley),
112
  )
113
- volley = 2
 
 
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, volley),
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, volley + 1),
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