def create_recipients(user_uid, machine_id, switch_id): recipient = Recipient() recipient.name = request.form['name'] recipient.email = request.form['email'] recipient.phone = request.form['phone'] recipient.user_id = user_uid recipient.tele_id = machine_id recipient.switch_id = switch_id db.session.add(recipient) db.session.commit() print(switch_id) return redirect(f'/recipient/{switch_id}/{user_uid}/{machine_id}')