mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-21 14:59:26 -04:00
reformat
This commit is contained in:
@@ -4,31 +4,38 @@ from app import db, version
|
||||
from app.dao.organization_dao import dao_count_organizations_with_live_services
|
||||
from app.dao.services_dao import dao_count_live_services
|
||||
|
||||
status = Blueprint('status', __name__)
|
||||
status = Blueprint("status", __name__)
|
||||
|
||||
|
||||
@status.route('/', methods=['GET'])
|
||||
@status.route('/_status', methods=['GET', 'POST'])
|
||||
@status.route("/", methods=["GET"])
|
||||
@status.route("/_status", methods=["GET", "POST"])
|
||||
def show_status():
|
||||
if request.args.get('simple', None):
|
||||
if request.args.get("simple", None):
|
||||
return jsonify(status="ok"), 200
|
||||
else:
|
||||
return jsonify(
|
||||
status="ok", # This should be considered part of the public API
|
||||
git_commit=version.__git_commit__,
|
||||
build_time=version.__time__,
|
||||
db_version=get_db_version()), 200
|
||||
return (
|
||||
jsonify(
|
||||
status="ok", # This should be considered part of the public API
|
||||
git_commit=version.__git_commit__,
|
||||
build_time=version.__time__,
|
||||
db_version=get_db_version(),
|
||||
),
|
||||
200,
|
||||
)
|
||||
|
||||
|
||||
@status.route('/_status/live-service-and-organization-counts')
|
||||
@status.route("/_status/live-service-and-organization-counts")
|
||||
def live_service_and_organization_counts():
|
||||
return jsonify(
|
||||
organizations=dao_count_organizations_with_live_services(),
|
||||
services=dao_count_live_services(),
|
||||
), 200
|
||||
return (
|
||||
jsonify(
|
||||
organizations=dao_count_organizations_with_live_services(),
|
||||
services=dao_count_live_services(),
|
||||
),
|
||||
200,
|
||||
)
|
||||
|
||||
|
||||
def get_db_version():
|
||||
query = 'SELECT version_num FROM alembic_version'
|
||||
query = "SELECT version_num FROM alembic_version"
|
||||
full_name = db.session.execute(query).fetchone()[0]
|
||||
return full_name
|
||||
|
||||
Reference in New Issue
Block a user