Skip to content

Commit

Permalink
fix pagination; fix rt tag
Browse files Browse the repository at this point in the history
  • Loading branch information
rstijerina committed Oct 31, 2024
1 parent cf96f7c commit 870f6fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions client/src/onboarding/layouts/OnboardingAdminLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions designsafe/apps/onboarding/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion designsafe/apps/onboarding/steps/project_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 870f6fa

Please sign in to comment.