Skip to content
Snippets Groups Projects
Commit a3b9093c authored by Mitchell Moore's avatar Mitchell Moore
Browse files

Check for creation

parent ca92d281
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,8 @@ def check_dir(user, interval): ...@@ -42,6 +42,8 @@ def check_dir(user, interval):
def create_account(username, fullname, reason): def create_account(username, fullname, reason):
# Todo: Ravi's and Louis's code go here # Todo: Ravi's and Louis's code go here
print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tUser ' + username + ' added to queue')
socketio.emit("creating account")
time.sleep(5) time.sleep(5)
...@@ -63,8 +65,6 @@ def ingest_data(json, methods=['GET', 'POST']): ...@@ -63,8 +65,6 @@ def ingest_data(json, methods=['GET', 'POST']):
try: try:
create_account(json['username'], json['fullname'], json['reason']) create_account(json['username'], json['fullname'], json['reason'])
print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tUser ' + json["username"] + ' added to queue')
socketio.emit("creating account")
except Exception as e: except Exception as e:
print(time.strftime("%m-%d-%Y_%H:%M:%S") + "\tError in account creation: ", e) print(time.strftime("%m-%d-%Y_%H:%M:%S") + "\tError in account creation: ", e)
...@@ -77,10 +77,8 @@ def creation_confirmation(json, methods=['GET', 'POST']): ...@@ -77,10 +77,8 @@ def creation_confirmation(json, methods=['GET', 'POST']):
# User create Script Approach # User create Script Approach
username = json["username"] username = json["username"]
fullname = json["fullname"]
reason = json["reason"]
if create_account(username, fullname, reason): if account_confirmation(username):
print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tAccount successfully created for ' + username) print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tAccount successfully created for ' + username)
socketio.emit("Account created") socketio.emit("Account created")
else: else:
......
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