Skip to content
Snippets Groups Projects
Commit 906bac72 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Update confirmation message

parent 3436edbf
No related branches found
No related tags found
6 merge requests!147Merge previous default branch feat-cod-rmq into main,!85kill nginx process running under user from login node,!51Fix acct create wait,!39WIP:Feat cod rmq,!38WIP: Feat cod rmq,!24Add notify user agent
...@@ -40,7 +40,8 @@ def notify_user(ch, method, properties, body): ...@@ -40,7 +40,8 @@ def notify_user(ch, method, properties, body):
msg = json.loads(body) msg = json.loads(body)
username = msg['username'] username = msg['username']
user_email = msg['email'] user_email = msg['email']
success = False msg['task'] = task
msg['success'] = False
email_body = Template(mail.body).render(username=username) email_body = Template(mail.body).render(username=username)
...@@ -62,7 +63,7 @@ def notify_user(ch, method, properties, body): ...@@ -62,7 +63,7 @@ def notify_user(ch, method, properties, body):
'body': email_body 'body': email_body
}) })
success = True msg['success'] = True
except: except:
e = sys.exc_info()[0] e = sys.exc_info()[0]
print("[{}]: Error: {}".format(task, e)) print("[{}]: Error: {}".format(task, e))
...@@ -74,10 +75,7 @@ def notify_user(ch, method, properties, body): ...@@ -74,10 +75,7 @@ def notify_user(ch, method, properties, body):
# send confirm message # send confirm message
rc_rmq.publish_msg({ rc_rmq.publish_msg({
'routing_key': 'confirm.' + username, 'routing_key': 'confirm.' + username,
'msg': { 'msg': msg
'task': task,
'success': success
}
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment