Skip to content

Commit

Permalink
create make_username and delete sandbox based on username
Browse files Browse the repository at this point in the history
  • Loading branch information
FellahAbdel committed Aug 9, 2024
1 parent 1409e44 commit fd4f4e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import os
import logging

from flask import Flask, request

from app.utils import create_keycloak_user, apply_k8s_config, delete_keycloak_user, delete_k8s_namespace, \
create_grafana_user, delete_grafana_user, make_username, make_usernames

app = Flask(__name__)
logger = logging.getLogger(__name__)


@app.route('/')
Expand All @@ -29,6 +31,7 @@ def provisioner():
username = None

if not email:

if not full_name:
return {'message': 'Email address and full name are missing'}, 400

Expand Down Expand Up @@ -94,7 +97,7 @@ def provisioner_clean():
'username': username
}
except Exception as e:
print(e)
logger.error(f"Failed to delete with this username : {username} : {e}", exc_info=True)

return {"Failed to delete user and related resources, it may not exist."}, 500

Expand Down

0 comments on commit fd4f4e3

Please sign in to comment.