Skip to content
Snippets Groups Projects
Unverified Commit c025bfa5 authored by Ravi Tripathi's avatar Ravi Tripathi Committed by GitHub
Browse files

Merge pull request #72 from diedpigs/feat-duplicate-report

Feature duplicate report tag
parents 05de62d5 c8b90928
No related branches found
No related tags found
3 merge requests!147Merge previous default branch feat-cod-rmq into main,!85kill nginx process running under user from login node,!78Feat cod rmq
...@@ -31,6 +31,5 @@ Whole_mail = Head + Body ...@@ -31,6 +31,5 @@ Whole_mail = Head + Body
UserReportHead = f"""From: {Sender_alias} <{Sender}> UserReportHead = f"""From: {Sender_alias} <{Sender}>
To: <{Admin_email}> To: <{Admin_email}>
Subject: RC Account Creation Report: {{{{ fullname }}}}, {{{{ username }}}} Subject: RC Account Creation Report: {{{{ fullname }}}}, {{{{ username }}}} """
"""
...@@ -39,7 +39,8 @@ record = { ...@@ -39,7 +39,8 @@ record = {
}, },
'notify': { 'notify': {
'notify_user': None 'notify_user': None
} },
'reported': False
} }
# Currently tracking users # Currently tracking users
...@@ -51,6 +52,8 @@ rc_rmq = RCRMQ({'exchange': 'RegUsr', 'exchange_type': 'topic'}) ...@@ -51,6 +52,8 @@ rc_rmq = RCRMQ({'exchange': 'RegUsr', 'exchange_type': 'topic'})
def notify_admin(username, user_record): def notify_admin(username, user_record):
receivers = [user_record['email'], mail_cfg.Admin_email] receivers = [user_record['email'], mail_cfg.Admin_email]
message = Template(mail_cfg.UserReportHead).render(username=username, fullname=user_record['fullname']) message = Template(mail_cfg.UserReportHead).render(username=username, fullname=user_record['fullname'])
if user_record['reported']:
message += ' (Duplicate)'
message += f""" \n message += f""" \n
User Creation Report for user {username} User Creation Report for user {username}
uid: {user_record["uid"]}, gid: {user_record["gid"]} uid: {user_record["uid"]}, gid: {user_record["gid"]}
...@@ -140,6 +143,8 @@ def task_manager(ch, method, properties, body): ...@@ -140,6 +143,8 @@ def task_manager(ch, method, properties, body):
current['verify']['subscribe_mail_list'] = user_db['subscribe_mail_list'] current['verify']['subscribe_mail_list'] = user_db['subscribe_mail_list']
current['notify']['notify_user'] = user_db['notify_user'] current['notify']['notify_user'] = user_db['notify_user']
current['reported'] = user_db['reported']
for t in ['git_commit', 'dir_verify', 'subscribe_mail_list']: for t in ['git_commit', 'dir_verify', 'subscribe_mail_list']:
if user_db[t] is None: if user_db[t] is None:
current['waiting'].add(t) current['waiting'].add(t)
......
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