Merge fbdfa2927f into 36e4a824f3
This commit is contained in:
commit
12cb04a579
2 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
|
@ -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)
|
||||
|
|
@ -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!")
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue