def get_drones(current_user_token):
    try:
        owner, current_user_token = verify_owner(current_user_token)
    except:
        bad_res = verify_owner(current_user_token)
        return bad_res
    drones = Drone.query.filter_by(user_id=owner.user_id).all()
    response = drones_schema.dump(drones)
    return jsonify(response)
Ejemplo n.º 2
0
def get_drones(current_user_token):
    try:
        owner, current_user_token = verify_owner(current_user_token)
    except:
        bad_res = verify_owner(current_user_token)
        return bad_res
    print(f'OWNER DATA: {owner}, CurrentUser: {current_user_token}')
    drones = Drone.query.filter_by(user_id=owner.user_id).all()
    response = drones_schema.dump(drones)
    return jsonify(response)
Ejemplo n.º 3
0
def get_drones(current_user_token):
    current_user_token = request.headers['X-Access-Token']
    owner_id = verify_owner(current_user_token)
    drones = Drone.query.filter_by(user_id = owner_id).all()
    response = drones_schema.dump(drones)
    return jsonify(response)