diff --git a/ansible_ai_connect/users/reports/generators.py b/ansible_ai_connect/users/reports/generators.py index 251b2f709..e3ced8c74 100644 --- a/ansible_ai_connect/users/reports/generators.py +++ b/ansible_ai_connect/users/reports/generators.py @@ -74,7 +74,6 @@ def generate( writer.writerow( [ "OrgId", - "Org has_api_key", "UUID", "First name", "Last name", @@ -82,6 +81,7 @@ def generate( "Plan name", "Trial started", "Trial expired_at", + "Org has_api_key", ] ) for user in users: @@ -89,7 +89,6 @@ def generate( for plan in user["userplan_set"]: row_data = [ organization["id"], - organization["has_api_key"], user["uuid"], user["given_name"], user["family_name"], @@ -97,6 +96,7 @@ def generate( plan["plan"]["name"], plan["created_at"], plan["expired_at"], + organization["has_api_key"], ] writer.writerow(row_data) diff --git a/ansible_ai_connect/users/reports/tests/test_generators.py b/ansible_ai_connect/users/reports/tests/test_generators.py index 2a0b550b1..baaaab934 100644 --- a/ansible_ai_connect/users/reports/tests/test_generators.py +++ b/ansible_ai_connect/users/reports/tests/test_generators.py @@ -155,8 +155,8 @@ def tearDown(self): def get_report_header(self) -> str: return ( - "OrgId,Org has_api_key,UUID,First name,Last name,Organization name," - "Plan name,Trial started,Trial expired_at" + "OrgId,UUID,First name,Last name,Organization name," + "Plan name,Trial started,Trial expired_at,Org has_api_key" ) def get_report_generator(self) -> BaseGenerator: