Пример #1
0
    def get(self, sess_id):
        qry = UserSession.get_user_by_session(sess_id)

        if qry is None:
            return jsonify(
                status=False,
                message="Your session has expired, please login again")

        user = User.query.filter(User.agent_id == qry.agent_id).first()

        return jsonify(status=True,
                       email=user.email,
                       first_name=user.first_name,
                       last_name=user.last_name)
Пример #2
0
 def delete(self, sess_id):
     session = UserSession.get_user_by_session(sess_id)
     db.session.delete(session)
     db.session.commit()