Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/errorhandling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ errors:
reading from the incoming data
- the database server was overloaded and could not handle the query
- a filesystem is full
- a harddrive crashed
- a hard drive crashed
- a backend server overloaded
- a programming error in a library you are using
- network connection of the server to another system failed
Expand Down Expand Up @@ -280,7 +280,7 @@ username and we can't find it, we raise a "404 Not Found".
# a successful request would be like /profile?username=jack
@app.route("/profile")
def user_profile():
username = request.arg.get("username")
username = request.args.get("username")
# if a username isn't supplied in the request, return a 400 bad request
if username is None:
abort(400)
Expand Down Expand Up @@ -494,7 +494,7 @@ This is a simple example:
# a correct request might be /api/user?user_id=420
@app.route("/api/user")
def user_api(user_id):
user_id = request.arg.get("user_id")
user_id = request.args.get("user_id")
if not user_id:
raise InvalidAPIUsage("No user id provided!")

Expand Down
2 changes: 1 addition & 1 deletion docs/views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function.
self.model = model
self.template = f"{model.__name__.lower()}/detail.html"

def dispatch_request(self, id)
def dispatch_request(self, id):
item = self.model.query.get_or_404(id)
return render_template(self.template, item=item)

Expand Down