You've already forked snikket-web-portal
Revert "Upgrade to quart 0.15"
This reverts commit 486596f89f.
It was discovered that multipart/form-data forms do not work
correctly with Quart 0.15. The upgrade to Quart 0.15 was rushed
and not tested correctly, which I apologize for.
See-Also: https://github.com/pgjones/quart/issues/126
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
aiohttp~=3.6
|
||||
quart~=0.15
|
||||
quart~=0.11
|
||||
flask-wtf~=0.14
|
||||
hsluv~=0.0.2
|
||||
flask-babel~=1.0
|
||||
|
||||
@@ -17,7 +17,6 @@ from quart import (
|
||||
redirect,
|
||||
jsonify,
|
||||
)
|
||||
import werkzeug.exceptions
|
||||
|
||||
import environ
|
||||
|
||||
@@ -41,7 +40,7 @@ async def proc() -> typing.Dict[str, typing.Any]:
|
||||
|
||||
try:
|
||||
user_info = await infra.client.get_user_info()
|
||||
except (aiohttp.ClientError, werkzeug.exceptions.HTTPException):
|
||||
except (aiohttp.ClientError, quart.exceptions.HTTPException):
|
||||
user_info = {}
|
||||
|
||||
return {
|
||||
@@ -106,16 +105,16 @@ async def backend_error_handler(exc: Exception) -> quart.Response:
|
||||
|
||||
|
||||
async def generic_http_error(
|
||||
exc: werkzeug.exceptions.HTTPException,
|
||||
exc: quart.exceptions.HTTPException,
|
||||
) -> quart.Response:
|
||||
return quart.Response(
|
||||
await render_template(
|
||||
"generic_http_error.html",
|
||||
status=exc.code,
|
||||
status=exc.status_code,
|
||||
description=exc.description,
|
||||
name=exc.name,
|
||||
),
|
||||
status=exc.code,
|
||||
status=exc.status_code,
|
||||
)
|
||||
|
||||
|
||||
@@ -199,7 +198,7 @@ def create_app() -> quart.Quart:
|
||||
backend_error_handler,
|
||||
)
|
||||
app.register_error_handler(
|
||||
werkzeug.exceptions.HTTPException,
|
||||
quart.exceptions.HTTPException,
|
||||
generic_http_error,
|
||||
)
|
||||
app.register_error_handler(
|
||||
|
||||
@@ -17,7 +17,6 @@ from quart import (
|
||||
Response,
|
||||
flash,
|
||||
)
|
||||
import werkzeug.exceptions
|
||||
|
||||
import babel
|
||||
import wtforms
|
||||
@@ -77,7 +76,7 @@ async def login() -> typing.Union[str, quart.Response]:
|
||||
password = form.password.data
|
||||
try:
|
||||
await client.login(jid, password)
|
||||
except werkzeug.exceptions.Unauthorized:
|
||||
except quart.exceptions.Unauthorized:
|
||||
form.password.errors.append(ERR_CREDENTIALS_INVALID)
|
||||
else:
|
||||
await flash(
|
||||
@@ -103,7 +102,7 @@ async def about() -> str:
|
||||
extra_versions["flask-wtf"] = flask_wtf.__version__
|
||||
try:
|
||||
extra_versions["Prosody"] = await client.get_server_version()
|
||||
except werkzeug.exceptions.Unauthorized:
|
||||
except quart.exceptions.Unauthorized:
|
||||
extra_versions["Prosody"] = "unknown"
|
||||
|
||||
return await render_template(
|
||||
|
||||
@@ -19,8 +19,7 @@ from quart import (
|
||||
current_app, _app_ctx_stack, session as http_session, abort, redirect,
|
||||
url_for,
|
||||
)
|
||||
import werkzeug.exceptions
|
||||
import quart
|
||||
import quart.exceptions
|
||||
|
||||
from . import xmpputil
|
||||
from .xmpputil import split_jid
|
||||
@@ -491,7 +490,7 @@ class ProsodyClient:
|
||||
session=session,
|
||||
)
|
||||
avatar_hash = avatar_info["sha1"]
|
||||
except werkzeug.exceptions.HTTPException:
|
||||
except quart.exceptions.HTTPException:
|
||||
avatar_hash = None
|
||||
|
||||
return {
|
||||
@@ -643,7 +642,7 @@ class ProsodyClient:
|
||||
new_access_model,
|
||||
)
|
||||
))
|
||||
except werkzeug.exceptions.NotFound:
|
||||
except quart.exceptions.NotFound:
|
||||
if ignore_not_found:
|
||||
return
|
||||
raise
|
||||
@@ -773,7 +772,7 @@ class ProsodyClient:
|
||||
session: aiohttp.ClientSession,
|
||||
) -> str:
|
||||
access_models = filter(
|
||||
lambda x: not isinstance(x, werkzeug.exceptions.NotFound),
|
||||
lambda x: not isinstance(x, quart.exceptions.NotFound),
|
||||
await asyncio.gather(
|
||||
self.get_avatar_access_model(session=session),
|
||||
self.get_nickname_access_model(session=session),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import asyncio
|
||||
import typing
|
||||
|
||||
import quart
|
||||
import quart.flask_patch
|
||||
from quart import (
|
||||
Blueprint,
|
||||
@@ -12,7 +11,7 @@ from quart import (
|
||||
flash,
|
||||
current_app,
|
||||
)
|
||||
import werkzeug.exceptions
|
||||
import quart.exceptions
|
||||
|
||||
import wtforms
|
||||
|
||||
@@ -93,8 +92,8 @@ async def change_pw() -> typing.Union[str, quart.Response]:
|
||||
form.current_password.data,
|
||||
form.new_password.data,
|
||||
)
|
||||
except (werkzeug.exceptions.Unauthorized,
|
||||
werkzeug.exceptions.Forbidden):
|
||||
except (quart.exceptions.Unauthorized,
|
||||
quart.exceptions.Forbidden):
|
||||
# server refused current password, set an appropriate error
|
||||
form.current_password.errors.append(
|
||||
_("Incorrect password."),
|
||||
|
||||
@@ -4,7 +4,7 @@ import typing
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from quart import abort
|
||||
import werkzeug.exceptions
|
||||
import quart.exceptions
|
||||
|
||||
|
||||
TAG_XMPP_ERROR = "error"
|
||||
@@ -234,7 +234,7 @@ def extract_pubsub_item_get_reply(
|
||||
) -> typing.Optional[ET.Element]:
|
||||
try:
|
||||
pubsub = extract_iq_reply(iq_tree, TAG_PUBSUB)
|
||||
except werkzeug.exceptions.NotFound:
|
||||
except quart.exceptions.NotFound:
|
||||
return None
|
||||
|
||||
if pubsub is None:
|
||||
|
||||
Reference in New Issue
Block a user