lots of typing fixes
This commit is contained in:
parent
51f580a304
commit
3665c34961
43 changed files with 260 additions and 178 deletions
|
@ -1,4 +1,5 @@
|
|||
from flask import Response, render_template, flash, redirect, url_for
|
||||
from flask.typing import ResponseReturnValue
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import SubmitField
|
||||
|
||||
|
@ -7,7 +8,7 @@ from app.models import AbstractResource
|
|||
from app.models.activity import Activity
|
||||
|
||||
|
||||
def response_404(message: str):
|
||||
def response_404(message: str) -> ResponseReturnValue:
|
||||
return Response(render_template("error.html.j2",
|
||||
header="404 Not Found",
|
||||
message=message))
|
||||
|
@ -20,7 +21,7 @@ def view_lifecycle(*,
|
|||
success_view: str,
|
||||
section: str,
|
||||
resource: AbstractResource,
|
||||
action: str):
|
||||
action: str) -> ResponseReturnValue:
|
||||
form = LifecycleForm()
|
||||
if action == "destroy":
|
||||
form.submit.render_kw = {"class": "btn btn-danger"}
|
||||
|
@ -54,5 +55,5 @@ def view_lifecycle(*,
|
|||
form=form)
|
||||
|
||||
|
||||
class LifecycleForm(FlaskForm):
|
||||
class LifecycleForm(FlaskForm): # type: ignore
|
||||
submit = SubmitField('Confirm')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue