Skip to content

Commit

Permalink
I forgot the use of alt_response changed slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
le717 committed Nov 21, 2022
1 parent 8921d60 commit e1d4faa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"module": "flask",
"console": "internalConsole",
"jinja": false,
"justMyCode": true,
"env": {
"FLASK_APP": "wsgi.py",
"FLASK_ENV": "development",
Expand Down
3 changes: 1 addition & 2 deletions src/blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
def _factory(partial_module_string: str, url_prefix: str) -> Blueprint:
"""Generate a blueprint registration."""
import_path = f"src.views.{partial_module_string}"
bp = Blueprint(partial_module_string, import_path, url_prefix=f"{url_prefix}")
return bp
return Blueprint(partial_module_string, import_path, url_prefix=url_prefix)


root = _factory("root", "/")
Expand Down
12 changes: 6 additions & 6 deletions src/core/models/HttpError.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import marshmallow as ma
from marshmallow import fields, Schema


__all__ = ["HttpError"]


class HttpError(ma.Schema):
class HttpError(Schema):
"""Simple HTTP error schema."""

code = ma.fields.Integer()
status = ma.fields.String()
message = ma.fields.String()
errors = ma.fields.Dict()
code = fields.Integer()
status = fields.String()
message = fields.String()
errors = fields.Dict()
2 changes: 1 addition & 1 deletion src/views/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def delete(self, **kwargs: Any):
@root.arguments(models.WebLinkId, location="path", as_kwargs=True)
@root.arguments(models.WebLinkUpdate, location="json", as_kwargs=True)
@root.response(204, models.Empty)
@root.alt_response(400, models.HttpError)
@root.alt_response(400, schema=models.HttpError)
def patch(self, **kwargs: Any):
"""Update a webring item."""
del kwargs["auth_key"]
Expand Down

0 comments on commit e1d4faa

Please sign in to comment.