From 812bb984085486a8ecc8c218889b1b4be105c201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Wed, 11 Sep 2024 14:14:23 -0500 Subject: [PATCH] reports: move position of "Org has_api_key" column (#1297) Move the `Org has_api_key` column to the last position. --- ansible_ai_connect/users/reports/generators.py | 4 ++-- ansible_ai_connect/users/reports/tests/test_generators.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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: