def new_recipe_step(cuisine_name, recipe_name): user = User.get_by_id(get_jwt_identity()) cuisine = Cuisine.get_or_none(name=cuisine_name) if user.is_admin: if cuisine: recipe = Recipe.get_or_none(name=recipe_name) if recipe: step_number = request.form.get("step_number") step_description = request.form.get("step_description") new_step = Step(number=step_number, description=step_description, recipe_id=recipe.id) new_step.save() return jsonify({"message": "Step successfully created!"}) else: return jsonify({"errors": "Recipe not exists"}) else: return jsonify({"errors": cuisine_name + " cusine is not exist"}) else: return 0