Skip to content

Commit

Permalink
Merge pull request #264 from uw-it-aca/task/student-labels-2
Browse files Browse the repository at this point in the history
add ethnicity values
  • Loading branch information
jlaney authored Sep 27, 2024
2 parents 30f82f6 + 06475ce commit 504cd85
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG DJANGO_CONTAINER_VERSION=2.0.2

FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-container:${DJANGO_CONTAINER_VERSION} as app-prebundler-container
FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-container:${DJANGO_CONTAINER_VERSION} AS app-prebundler-container

USER root

Expand Down Expand Up @@ -29,13 +29,13 @@ ARG VUE_DEVTOOLS
ENV VUE_DEVTOOLS=$VUE_DEVTOOLS
RUN npm run build

FROM app-prebundler-container as app-container
FROM app-prebundler-container AS app-container

COPY --chown=acait:acait --from=node-bundler /app/sis_provisioner/static /app/sis_provisioner/static

RUN /app/bin/python manage.py collectstatic --noinput

FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-test-container:${DJANGO_CONTAINER_VERSION} as app-test-container
FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-test-container:${DJANGO_CONTAINER_VERSION} AS app-test-container

USER root

Expand Down
3 changes: 3 additions & 0 deletions docker/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@
'DRS',
'athlete',
'veteran',
'ethnicity_group',
'ethnicity_name',
'URM',
]

MAJOR_COLLEGE_OVERRIDES = {
Expand Down
7 changes: 6 additions & 1 deletion sis_provisioner/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from sis_provisioner.utils import (
get_majors, get_major_names, get_primary_major_name, is_athlete,
is_veteran, get_college_names, get_class_desc, get_education_level_name,
format_student_number, format_name)
get_ethnicity, format_student_number, format_name)
from datetime import datetime, timezone
from logging import getLogger
import csv
Expand Down Expand Up @@ -346,6 +346,8 @@ def _generate_csv(self):
if student.person.uwnetid in blocked_students:
continue

ethnic_group, ethnic_desc, ethnic_urm = get_ethnicity(student)

writer.writerow([
'{}@{}'.format(student.person.uwnetid, settings.EMAIL_DOMAIN),
'User',
Expand All @@ -355,6 +357,9 @@ def _generate_csv(self):
TRUE if student.disability_ind else FALSE,
TRUE if is_athlete(student) else FALSE,
student.veteran_benefit_code,
ethnic_group,
ethnic_desc,
TRUE if ethnic_urm else FALSE,
])
return s.getvalue()

Expand Down
13 changes: 13 additions & 0 deletions sis_provisioner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,19 @@ def get_college_names(majors, campus=0):
return ';'.join(college_names) if len(college_names) else ''


def get_ethnicity(student):
if student.ethnic_under_rep:
return student.ethnic_group_desc, student.ethnic_long_desc, True
elif student.hispanic_under_rep:
return student.hispanic_group_desc, student.hispanic_long_desc, True
elif student.ethnic_code:
return student.ethnic_group_desc, student.ethnic_long_desc, False
elif student.hispanic_code:
return student.hispanic_group_desc, student.hispanic_long_desc, False
else:
return '', '', False


def format_name(first_name, surname):
try:
full_name = ' '.join([first_name, surname])
Expand Down

0 comments on commit 504cd85

Please sign in to comment.