Fix(API): Stop mypy from complaining
This commit is contained in:
		@@ -1,7 +1,6 @@
 | 
			
		||||
from quart import Blueprint, ResponseReturnValue
 | 
			
		||||
from quart_rate_limiter import rate_exempt
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
blueprint = Blueprint("control", __name__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ async def insert_member(db: Connection, email: str, password_hash: str) -> Membe
 | 
			
		||||
                       email_verified""",
 | 
			
		||||
        {"email": email, "password_hash": password_hash},
 | 
			
		||||
    )
 | 
			
		||||
    return Member(**result)
 | 
			
		||||
    return Member(**result)  # type: ignore
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
async def update_member_password(db: Connection, id: int, password_hash: str) -> None:
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@ async def select_todos(
 | 
			
		||||
                    WHERE member_id = :member_id
 | 
			
		||||
                          AND complete = :complete"""
 | 
			
		||||
        values = {"member_id": member_id, "complete": complete}
 | 
			
		||||
    return [Todo(**row) async for row in connection.iterate(query, values)]
 | 
			
		||||
    return [Todo(**row) async for row in await connection.iterate(query, values)]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
async def select_todo(
 | 
			
		||||
@@ -64,7 +64,7 @@ async def insert_todo(
 | 
			
		||||
            "due": due,
 | 
			
		||||
        },
 | 
			
		||||
    )
 | 
			
		||||
    return Todo(**result)
 | 
			
		||||
    return Todo(**result)  # type: ignore
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
async def update_todo(
 | 
			
		||||
 
 | 
			
		||||
@@ -1,32 +1,29 @@
 | 
			
		||||
from quart import Quart, ResponseReturnValue
 | 
			
		||||
 | 
			
		||||
# logging
 | 
			
		||||
import logging
 | 
			
		||||
import os
 | 
			
		||||
from subprocess import call  # nosec
 | 
			
		||||
from urllib.parse import urlparse
 | 
			
		||||
 | 
			
		||||
from quart import Quart, ResponseReturnValue
 | 
			
		||||
 | 
			
		||||
# Authentication
 | 
			
		||||
from quart_auth import AuthManager
 | 
			
		||||
 | 
			
		||||
# PostgreSQL database driver
 | 
			
		||||
from quart_db import QuartDB
 | 
			
		||||
 | 
			
		||||
# Rate limiting
 | 
			
		||||
from quart_rate_limiter import RateLimiter, RateLimitExceeded
 | 
			
		||||
 | 
			
		||||
# Request/Response validation
 | 
			
		||||
from quart_schema import QuartSchema, RequestSchemaValidationError
 | 
			
		||||
 | 
			
		||||
# Each blueprint is a logical collection of features in our web app
 | 
			
		||||
from backend.blueprints.control import blueprint as control_blueprint
 | 
			
		||||
 | 
			
		||||
# For making sure error responses are in JSON format
 | 
			
		||||
from backend.lib.api_error import APIError
 | 
			
		||||
 | 
			
		||||
# Rate limiting
 | 
			
		||||
from quart_rate_limiter import RateLimiter
 | 
			
		||||
from quart_rate_limiter import RateLimitExceeded
 | 
			
		||||
 | 
			
		||||
# Authentication
 | 
			
		||||
from quart_auth import AuthManager
 | 
			
		||||
 | 
			
		||||
# Request/Response validation
 | 
			
		||||
from quart_schema import QuartSchema, RequestSchemaValidationError
 | 
			
		||||
 | 
			
		||||
# PostgreSQL database driver
 | 
			
		||||
from quart_db import QuartDB
 | 
			
		||||
 | 
			
		||||
# logging
 | 
			
		||||
import logging
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
app: Quart = Quart(__name__)
 | 
			
		||||
 | 
			
		||||
# Configure the web app
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user