Skip to content

Commit

Permalink
Add volunteer roles to department CSV
Browse files Browse the repository at this point in the history
Requested via Slack.
  • Loading branch information
kitsuta committed Aug 21, 2024
1 parent f5c8029 commit 3827de5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions uber/site_sections/dept_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import timedelta

from uber.config import c
from uber.custom_tags import pluralize, yesno
from uber.custom_tags import pluralize, yesno, readable_join
from uber.decorators import all_renderable, ajax, check_dept_admin, csrf_protected, csv_file, department_id_adapter, \
requires_dept_admin, site_mappable
from uber.errors import HTTPRedirect
Expand Down Expand Up @@ -201,7 +201,7 @@ def dept_requests_export(self, out, session, department_id, requested_any=False,
def dept_members_export(self, out, session, department_id, message='', **params):
department = session.query(Department).get(department_id)
headers = ['Name', 'Legal Name', 'Email', 'Phone Number', 'Emergency Contact',
'Weighted Hours', 'Badge Status', 'Placeholder', 'Has Shifts']
'Weighted Hours', 'Badge Status', 'Placeholder', 'Has Shifts', 'Roles']

out.writerow(headers)
for attendee in department.members:
Expand All @@ -210,7 +210,8 @@ def dept_members_export(self, out, session, department_id, message='', **params)
attendee.weighted_hours_in(department),
attendee.badge_status_label,
yesno(attendee.placeholder, 'Yes,No'),
yesno(attendee.weighted_hours_in(department) > 0, 'Yes,No')]
yesno(attendee.weighted_hours_in(department) > 0, 'Yes,No'),
readable_join([role.name for role in attendee.dept_roles])]

out.writerow(row)

Expand Down

0 comments on commit 3827de5

Please sign in to comment.