Fix Mypy issue

This commit is contained in:
Thomas Sileo 2019-08-01 20:01:40 +02:00
parent d8d9aad67a
commit c47753c0fa

View file

@ -1,5 +1,6 @@
import json import json
import mimetypes import mimetypes
from typing import Any
import flask import flask
from flask import Response from flask import Response
@ -16,7 +17,7 @@ blueprint = flask.Blueprint("well_known", __name__)
@blueprint.route("/.well-known/webfinger") @blueprint.route("/.well-known/webfinger")
def wellknown_webfinger() -> _Response: def wellknown_webfinger() -> Any:
"""Exposes/servers WebFinger data.""" """Exposes/servers WebFinger data."""
resource = request.args.get("resource") resource = request.args.get("resource")
if resource not in [f"acct:{config.USERNAME}@{config.DOMAIN}", config.ID]: if resource not in [f"acct:{config.USERNAME}@{config.DOMAIN}", config.ID]:
@ -52,7 +53,7 @@ def wellknown_webfinger() -> _Response:
@blueprint.route("/.well-known/nodeinfo") @blueprint.route("/.well-known/nodeinfo")
def wellknown_nodeinfo() -> _Response: def wellknown_nodeinfo() -> Any:
"""Exposes the NodeInfo endpoint (http://nodeinfo.diaspora.software/).""" """Exposes the NodeInfo endpoint (http://nodeinfo.diaspora.software/)."""
return flask.jsonify( return flask.jsonify(
links=[ links=[
@ -65,7 +66,7 @@ def wellknown_nodeinfo() -> _Response:
@blueprint.route("/nodeinfo") @blueprint.route("/nodeinfo")
def nodeinfo() -> _Response: def nodeinfo() -> Any:
"""NodeInfo endpoint.""" """NodeInfo endpoint."""
q = { q = {
"box": Box.OUTBOX.value, "box": Box.OUTBOX.value,