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

Update task manager to handle aup

parent 4defb017
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,7 @@ record = { ...@@ -37,6 +37,7 @@ record = {
}, },
"notify": {"notify_user": None}, "notify": {"notify_user": None},
"reported": False, "reported": False,
"aup": False,
} }
# Currently tracking users # Currently tracking users
...@@ -117,6 +118,7 @@ def insert_db(username, msg): ...@@ -117,6 +118,7 @@ def insert_db(username, msg):
"notify_user": None, "notify_user": None,
"sent": None, "sent": None,
"reported": False, "reported": False,
"aup": msg.get("aup", False),
"last_update": datetime.now(), "last_update": datetime.now(),
"queuename": msg.get("queuename", ""), "queuename": msg.get("queuename", ""),
} }
...@@ -150,6 +152,7 @@ def task_manager(ch, method, properties, body): ...@@ -150,6 +152,7 @@ def task_manager(ch, method, properties, body):
) )
current["uid"] = user_db["uid"] if user_db else msg["uid"] current["uid"] = user_db["uid"] if user_db else msg["uid"]
current["gid"] = user_db["gid"] if user_db else msg["gid"] current["gid"] = user_db["gid"] if user_db else msg["gid"]
current["aup"] = user_db["aup"] if user_db else msg["aup"]
current["email"] = user_db["email"] if user_db else msg["email"] current["email"] = user_db["email"] if user_db else msg["email"]
current["reason"] = user_db["reason"] if user_db else msg["reason"] current["reason"] = user_db["reason"] if user_db else msg["reason"]
current["fullname"] = ( current["fullname"] = (
...@@ -202,6 +205,7 @@ def task_manager(ch, method, properties, body): ...@@ -202,6 +205,7 @@ def task_manager(ch, method, properties, body):
"queuename": queuename, "queuename": queuename,
"uid": current["uid"], "uid": current["uid"],
"gid": current["gid"], "gid": current["gid"],
"aup": current["aup"],
"email": current["email"], "email": current["email"],
"reason": current["reason"], "reason": current["reason"],
"fullname": current["fullname"], "fullname": current["fullname"],
...@@ -277,7 +281,10 @@ def task_manager(ch, method, properties, body): ...@@ -277,7 +281,10 @@ def task_manager(ch, method, properties, body):
update_db(username, {"reported": True}) update_db(username, {"reported": True})
rc_util.update_state(username, "ok") if current["aup"]:
rc_util.update_state(username, "ok")
else:
rc_util.update_state(username, "certification")
tracking.pop(username) tracking.pop(username)
......
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