Exemple #1
0
    def post(self):
        if User_tool.check_before_start("deleteCar", self) >= 0:

            dati = json.loads(self.request.body)
            user_data = dati["User"]
            car_data = dati["Car"]

            temp_user = User.static_querySearch_email(user_data["Email"])
            user = temp_user.get()
            id_user = user.key.id()

            User_car.deleteCarUser(id_user, car_data["ID_car"])
            user_car = User_car.getUserFromCar(car_data["ID_car"])

            if static_variable.DEBUG:
                logging.debug("Number of car with this user: "******"ID_car"])

            right = StatusReturn(7, "deleteCar")
            self.response.write(right.print_result())
Exemple #2
0
    def post(self):
        if User_tool.check_before_start("deleteCar", self) >= 0:

            dati = json.loads(self.request.body)
            user_data = dati["User"]
            car_data = dati["Car"]

            temp_user = User.static_querySearch_email(user_data["Email"])
            user = temp_user.get()
            id_user = user.key.id()

            User_car.deleteCarUser(id_user, car_data["ID_car"])
            user_car = User_car.getUserFromCar(car_data["ID_car"])

            if static_variable.DEBUG:
                logging.debug("Number of car with this user: "******"ID_car"])

            right = StatusReturn(7, "deleteCar")
            self.response.write(right.print_result())
Exemple #3
0
 def post(self):
     if User_tool.check_before_start("deleteCar", self) >= 0:
         data = json.loads(self.request.body)
         Car.delete_car_ID(data["ID"])
         right = StatusReturn(7, "deleteCar", "Delete " + str(data["ID"]))
         self.response.write(right.print_result())