Skip to content

Commit cdd43c3

Browse files
committed
Merge branch 'master' into asyncio
2 parents aff631c + 0684c52 commit cdd43c3

File tree

52 files changed

+5453
-3643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5453
-3643
lines changed

autoflow/Pipfile.lock

Lines changed: 164 additions & 172 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deployment/Pipfile.lock

Lines changed: 102 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/Pipfile.lock

Lines changed: 1066 additions & 864 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flowapi/Pipfile.lock

Lines changed: 222 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flowapi/flowapi/flowapi_errors.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
11
# This Source Code Form is subject to the terms of the Mozilla Public
22
# License, v. 2.0. If a copy of the MPL was not distributed with this
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4-
from quart.exceptions import HTTPException
4+
from werkzeug.exceptions import BadRequest
55
import rapidjson as json
66

77

8-
class JSONHTTPException(HTTPException):
9-
def get_body(self) -> str:
8+
class JSONHTTPException(BadRequest):
9+
def get_body(self, environ, scope) -> str:
1010
return json.dumps({"msg": self.description})
1111

12-
def get_headers(self) -> dict:
13-
return {"Content-Type": "application/json"}
12+
def get_headers(self, environ, scope) -> dict:
13+
return [("Content-Type", "application/json")]
1414

1515

1616
class BadQueryError(JSONHTTPException):
17+
name = "Bad query"
18+
1719
def __init__(self):
1820
super().__init__(
19-
status_code=400, description="Could not parse query spec.", name="Bad query"
21+
description="Could not parse query spec.",
2022
)
2123

2224

2325
class MissingQueryKindError(JSONHTTPException):
2426
def __init__(self):
2527
super().__init__(
26-
status_code=400,
2728
description="Query kind must be specified when running a query.",
28-
name="Bad query",
2929
)
3030

3131

3232
class MissingAggregationUnitError(JSONHTTPException):
3333
def __init__(self):
3434
super().__init__(
35-
status_code=400,
3635
description="Aggregation unit must be specified when running a query.",
37-
name="Bad query",
3836
)

flowapi/flowapi/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
from quart import request
7-
from quart.exceptions import HTTPException
7+
from werkzeug.exceptions import NotFound
88

99

1010
async def get_query_parameters_from_flowmachine(*, query_id) -> dict:
@@ -36,9 +36,7 @@ async def get_query_parameters_from_flowmachine(*, query_id) -> dict:
3636
)
3737
reply = await request.socket.recv_json()
3838
if reply["status"] == "error":
39-
raise HTTPException(
39+
raise NotFound(
4040
description=f"Unknown query ID '{query_id}'",
41-
name="Query ID not found",
42-
status_code=404,
4341
)
4442
return reply["payload"]["query_params"]

flowauth/Pipfile.lock

Lines changed: 740 additions & 307 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flowauth/backend/flowauth/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from .models import *
1111

12-
blueprint = Blueprint(__name__, __name__)
12+
blueprint = Blueprint(__name__.split(".").pop(), __name__)
1313
admin_permission = Permission(RoleNeed("admin"))
1414

1515

flowauth/backend/flowauth/groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .invalid_usage import InvalidUsage
1010
from .models import *
1111

12-
blueprint = Blueprint(__name__, __name__)
12+
blueprint = Blueprint(__name__.split(".").pop(), __name__)
1313
admin_permission = Permission(RoleNeed("admin"))
1414

1515

flowauth/backend/flowauth/login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .invalid_usage import InvalidUsage, Unauthorized
1313
from .models import *
1414

15-
blueprint = Blueprint(__name__, __name__)
15+
blueprint = Blueprint(__name__.split(".").pop(), __name__)
1616

1717

1818
@blueprint.route("/signin", methods=["POST"])

0 commit comments

Comments
 (0)