mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
add debug
This commit is contained in:
@@ -2,6 +2,8 @@ import json
|
||||
|
||||
from flask import abort, current_app, flash, redirect, render_template, session, url_for
|
||||
from itsdangerous import SignatureExpired
|
||||
from app.notify_client import service_api_client
|
||||
from app.utils import hilite
|
||||
from notifications_utils.url_safe_token import check_token
|
||||
|
||||
from app import user_api_client
|
||||
@@ -68,16 +70,29 @@ def activate_user(user_id):
|
||||
|
||||
# This is the login.gov path
|
||||
login_gov_invite_data = redis_client.get(f"service-invite-{user.email_address}")
|
||||
# TODO REMOVE THIS DEBUG
|
||||
print(hilite(f"DATA FROM REDIS WITH USER EMAIL {user.email_address}? DATA: {login_gov_invite_data}"))
|
||||
# END DEBUG
|
||||
if login_gov_invite_data:
|
||||
login_gov_invite_data = json.loads(login_gov_invite_data.decode("utf8"))
|
||||
service_id = login_gov_invite_data["service_id"]
|
||||
user_id = user_id
|
||||
permissions = login_gov_invite_data["permissions"]
|
||||
folder_permissions = login_gov_invite_data["folder_permissions"]
|
||||
# TODO REMOVE THIS DEBUG
|
||||
print(hilite(f"CALLING BACK END WITH {login_gov_invite_data}"))
|
||||
# END DEBUG
|
||||
# Actually call the back end and add the user to the service
|
||||
user_api_client.add_user_to_service(
|
||||
service_id, user_id, permissions, folder_permissions
|
||||
)
|
||||
# TODO REMOVE THIS DEBUG
|
||||
print(hilite(f"ADDING USER TO SERVICE service_id {service_id} user_id {user_id} permissions {permissions}"))
|
||||
orgs_and_services = user_api_client.get_organisations_and_services_for_user(user_id)
|
||||
print(hilite(f"ORGS AND SERVICES FOR USER {orgs_and_services}"))
|
||||
service_added = service_api_client.get_service(service_id)
|
||||
print(hilite("USER {user.name} SHOULD HAVE BEEN ADDED TO SERVICE {service_added.name}"))
|
||||
# END DEBUG
|
||||
|
||||
# This is the deprecated path for organization invites where we get id from session
|
||||
session["current_session_id"] = user.current_session_id
|
||||
|
||||
Reference in New Issue
Block a user