Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions coldfront/core/user/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def is_approver(self):
def schools(self):
"""Get schools from ApproverProfile if the user is an approver."""
if hasattr(self, 'approver_profile'):
return list(self.approver_profile.schools.values_list('description', flat=True))
return []
return self.approver_profile.schools.all()
return School.objects.none()

@schools.setter
def schools(self, values):
Expand Down
4 changes: 2 additions & 2 deletions coldfront/core/user/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_approver_profile_creation(self):

# Convert both lists to sets to ignore order
expected_schools = {"Tandon School of Engineering", "NYU IT"}
actual_schools = set(self.data.user_profile.schools)
actual_schools = {school.description for school in self.data.user_profile.schools}

self.assertEqual(expected_schools, actual_schools)

Expand All @@ -100,7 +100,7 @@ def test_schools_property_getter(self):

# Convert both lists to sets to ignore order
expected_schools = {"Tandon School of Engineering", "NYU IT"}
actual_schools = set(self.data.user_profile.schools)
actual_schools = {school.description for school in self.data.user_profile.schools}

self.assertEqual(expected_schools, actual_schools)

Expand Down
Loading