def loginmsg(loggedin): print('This is {}'.format(loggedin)) sessionobj = Sessions(loggedin['user']) sessionadded = sessionobj.addsession(request.sid) print(sessionadded) if sessionadded == 'error': # resp=make_response(jsonify(status='success'),200) resp = 'exist' else: # resp=make_response(jsonify(status='success'),200) emit('sessionadd', loggedin['user'], include_self=False, broadcast=True) resp = 'success' return resp
def addsessions(username): sessionobj = Sessions(username) sessionadded = sessionobj.addsession() resp = make_response(jsonify(status='success'), 200) return resp