diff --git a/app/templates/auth/SignUp.html b/app/templates/auth/SignUp.html index 44bff773fa7eb55c4ee884cd8f47ff98d17870c5..fbd03d35c3399bf18e2fe93d29299179c707f35b 100644 --- a/app/templates/auth/SignUp.html +++ b/app/templates/auth/SignUp.html @@ -105,7 +105,7 @@ <input class="form-control" id="fullname" name="fullname" placeholder="Enter Full Name" required="" type="text"> <label><b><label for="reason">Reason for Requesting Account: </label><br></b></label> <textarea class="form-control" id="reason" name="reason" placeholder="Enter Reason for Account Request" required=""></textarea> - <input class="btn btn-primary btn-block" id="submit" name="submit" type="button" value="Submit" onclick="request_account()"> + <input class="btn btn-primary btn-block" id="submit" name="submit" type="button" value="Submit" onclick="displayloading();request_account()"> <div> <strong id="error" style="color: #be051b; text-align: center;"></strong> diff --git a/run.py b/run.py index ea80ec7087108d70299dcf9b9e23cf4d8ac63370..71bceb0df33604b86d8fca37b84b34ec0f22e5d1 100644 --- a/run.py +++ b/run.py @@ -31,7 +31,7 @@ def user_connected(json, methods=['GET', 'POST']): @socketio.on('request account') def request_account(json, methods=['GET', 'POST']): - socketio.emit("creating account") + print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tQueue request received: ' + str(json)) room = str(session['uid']) @@ -39,6 +39,7 @@ def request_account(json, methods=['GET', 'POST']): try: + socketio.emit("creating account") #create_account(json['username'], json['fullname'], json['reason']) tasks.celery_create_account(json['username'], json['fullname'], json['reason'], room, socketio) diff --git a/tasks.py b/tasks.py index b19f450f556a151d2912cb70d82e1de109277dd2..827d5195101f598b6b2bff98a8551709afb1db9d 100644 --- a/tasks.py +++ b/tasks.py @@ -11,9 +11,9 @@ celery = Celery('flask_user_reg', broker='amqp://') @celery.task def celery_create_account(username, fullname, reason, room, socketio): - # Todo: Ravi's and Louis's code goes here + print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tUser ' + username + ' added to queue') #socketio.emit("creating account", room=room) - time.sleep(5) + time.sleep(10) print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tAccount successfully created for ' + username) socketio.emit('account ready', room=room)