From 1e7d99e853982ab9f1d976e87e95329b9192cb6d Mon Sep 17 00:00:00 2001 From: Ryan Ahearn Date: Fri, 18 Nov 2022 12:39:50 -0500 Subject: [PATCH] Fix flake8 and isort findings --- app/commands.py | 4 +++- app/docs/__init__.py | 1 + docs/api-usage.md | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/commands.py b/app/commands.py index 1529d9c37..097d1f885 100644 --- a/app/commands.py +++ b/app/commands.py @@ -1,9 +1,9 @@ import csv import functools import itertools -from os import getenv import uuid from datetime import datetime, timedelta +from os import getenv import click import flask @@ -748,6 +748,7 @@ def create_test_user(name, email, mobile_number, password, auth_type, state, adm print("duplicate user", user.name) db.session.rollback() + @notify_command(name='create-admin-jwt') def create_admin_jwt(): if getenv('NOTIFY_ENVIRONMENT', '') != 'development': @@ -755,6 +756,7 @@ def create_admin_jwt(): return print(create_jwt_token(current_app.config['SECRET_KEY'], current_app.config['ADMIN_CLIENT_ID'])) + @notify_command(name='create-user-jwt') @click.option('-t', '--token', required=True, prompt=False) def create_user_jwt(token): diff --git a/app/docs/__init__.py b/app/docs/__init__.py index 2ac289131..571f594b1 100644 --- a/app/docs/__init__.py +++ b/app/docs/__init__.py @@ -4,6 +4,7 @@ from flask import Blueprint, current_app, send_file docs = Blueprint('docs', __name__, url_prefix='/docs') + @docs.route('/openapi.yml', methods=['GET']) def send_openapi(): openapi_schema = path.join(current_app.root_path, '../docs/openapi.yml') diff --git a/docs/api-usage.md b/docs/api-usage.md index e7a8d2969..24200c432 100644 --- a/docs/api-usage.md +++ b/docs/api-usage.md @@ -27,7 +27,7 @@ flask command create-admin-jwt | tail -n 1 | pbcopy flask command create-user-jwt --token= | tail -n 1 | pbcopy ``` -to copy a token usable by the admin UI to your pasteboard. This token will expire in 30 seconds +to copy a token to your pasteboard. This token will expire in 30 seconds ### Disable token expiration checking in development