0

I have been stuck on pset7 finance due to an error called 'unexpected unident'. It is giving me an error on the @app.route("/history) portion, the arrow is specifically pointing to the @ symbol. I haven't moved the template, only added my code so not sure why this is happening. Thank you in advance!

File "application.py", line 111 @app.route("/history")
^

IndentationError: unexpected unindent

@app.route("/history")
@login_required def history():

"""Show history of transactions."""
history=db.execute("SELECT * from history WHERE id=:id;", id=session["user_id"])

    return render_template("history.html", history=history)

1 Answer 1

0

When posting python code it is of the utmost importance that it be formatted correctly, since indenting is so integral. Edit your question, select the code, click the {} in the format bar and ta-da, it will be formatted.

Your problem probably lies before line 111. It is some command, like a def or for that has a : terminator and is expecting its following line to be indented.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .