예제 #1
0
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
예제 #2
0
def addsessions(username):
    sessionobj = Sessions(username)
    sessionadded = sessionobj.addsession()
    resp = make_response(jsonify(status='success'), 200)
    return resp