Commit c3e552ec authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

pass user input as a json object from flask to celery

parent 2edc9b99
......@@ -36,7 +36,7 @@ def request_account(json, methods=['GET', 'POST']):
room = str(session['uid'])
print("Room: {}".format(room))
tasks.celery_create_account.delay(json['username'], json['email'], json['fullname'], json['reason'], session=room)
tasks.celery_create_account.delay(json, session=room )
except Exception as e:
print(time.strftime("%m-%d-%Y_%H:%M:%S") + "\tError in account creation: ", e)
socketio.emit("Account creation failed", room)
......@@ -19,8 +19,13 @@ def send_msg(event, room):
def celery_create_account(username, fullname, reason, session):
def celery_create_account(json, session):
room = session
username= json['username']
email= json['email']
fullname= json['fullname']
reason= json['reason']
print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tUser ' + username + ' added to queue')
send_msg('creating account', room)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment