From 870f6faf1418e63794c9848ade7252c6a3758289 Mon Sep 17 00:00:00 2001 From: Sal Tijerina Date: Thu, 31 Oct 2024 15:41:59 -0500 Subject: [PATCH] fix pagination; fix rt tag --- client/src/onboarding/layouts/OnboardingAdminLayout.tsx | 4 ++-- designsafe/apps/onboarding/api/views.py | 4 ++-- designsafe/apps/onboarding/steps/project_membership.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/onboarding/layouts/OnboardingAdminLayout.tsx b/client/src/onboarding/layouts/OnboardingAdminLayout.tsx index 3fbe514fa2..f84f3f24f6 100644 --- a/client/src/onboarding/layouts/OnboardingAdminLayout.tsx +++ b/client/src/onboarding/layouts/OnboardingAdminLayout.tsx @@ -215,9 +215,9 @@ const OnboardingAdminList: React.FC<{ defaultPageSize: 20 * totalSteps, // 20 users with $totalSteps steps each defaultCurrent: 1, current: +(searchParams.get('page') as string) || undefined, - hideOnSinglePage: true, + hideOnSinglePage: false, showSizeChanger: false, - total, + total: total * 20 * totalSteps, // total elements = total users * 20 users per page * total steps onChange: (page, _) => { searchParams.set('page', page.toString()); setSearchParams(searchParams); diff --git a/designsafe/apps/onboarding/api/views.py b/designsafe/apps/onboarding/api/views.py index 7cde5329ca..218cf40f77 100644 --- a/designsafe/apps/onboarding/api/views.py +++ b/designsafe/apps/onboarding/api/views.py @@ -297,11 +297,11 @@ def get(self, request): total = math.ceil(len(results) / limit) offset = (page - 1) * limit - page = results[offset : limit * page] # noqa: E203 + users_in_page = results[offset : limit * page] # noqa: E203 account_setup_steps = getattr(settings, "PORTAL_USER_ACCOUNT_SETUP_STEPS", []) # Assemble an array with the User data we care about - for user in page: + for user in users_in_page: try: users.append(get_user_onboarding(user)) except ObjectDoesNotExist as err: diff --git a/designsafe/apps/onboarding/steps/project_membership.py b/designsafe/apps/onboarding/steps/project_membership.py index d29d311e08..7724330c8c 100644 --- a/designsafe/apps/onboarding/steps/project_membership.py +++ b/designsafe/apps/onboarding/steps/project_membership.py @@ -88,7 +88,7 @@ def send_project_request(self, request): Subject=f"{self.project['title']} Project Membership Request for {self.user.username}", Text=ticket_text, Requestors=self.user.email, - CF_resource=settings.RT_TAG, + CF_resource=self.settings.get("rt_tag") or "", ) tracker.logout()