Process lots of feedback

- Add a lot of docstrings
- Add AppStatus class
- Remove unused code
This commit is contained in:
Maarten de Waard 2022-09-28 09:46:56 +02:00
parent 8e41705d39
commit 2e55e2fa39
No known key found for this signature in database
GPG key ID: 1D3E893A657CC8DA
5 changed files with 221 additions and 777 deletions

View file

@ -17,7 +17,7 @@ from config import HYDRA_ADMIN_URL, KRATOS_ADMIN_URL, KRATOS_PUBLIC_URL
from helpers import KratosUser
from cliapp import cli
from areas.roles import Role
from areas.apps import AppRole, App, APP_NOT_INSTALLED_STATUS
from areas.apps import AppRole, App
from database import db
# APIs
@ -135,7 +135,7 @@ def status_app(slug):
current_app.logger.error(f"App {slug} does not exist")
return
current_app.logger.info(f"Status: {app.get_status()}")
current_app.logger.info(app.get_status())
@app_cli.command("install")
@click.argument("slug")
@ -152,13 +152,12 @@ def install_app(slug):
return
current_status = app.get_status()
if current_status == APP_NOT_INSTALLED_STATUS:
if current_status.installed == False:
app.install()
current_app.logger.info(
f"App {slug} installing... use `status` to see status")
else:
current_app.logger.error("App {slug} should have status"
f" {APP_NOT_INSTALLED_STATUS} but has status: {current_status}")
current_app.logger.error(f"App {slug} is already installed")
@app_cli.command("roles")
@click.argument("slug")