I am trying to create a function in Flask that will make the response of the function say_bye bold. I am testing the make bold function to see if it returns a value. I am getting a non type error that says the function is either returning None or does not have a return statement. I’ve run all of the functions without the make_bold function and they return values. I’ve also checked and the make_bold function does have a return statement where it is returning the wrapper_function. Can someone tell me why this is happening in my code?
from flask import Flask
app = Flask(__name__)
def make_bold(function):
def wrapper_function():
function()
print("Test")
return wrapper_function
@app.route("/bye")
@make_bold
def say_bye():
return "Bye!"
if __name__ == "__main__":
app.run(debug=True)