EDUCATOR-5127 - update message

This commit is contained in:
atesker
2020-06-30 09:35:04 -04:00
committed by Andytr1
parent 061faba726
commit d70303a893
2 changed files with 3 additions and 8 deletions

View File

@@ -371,16 +371,12 @@ class TeamMembershipImportManager(object):
if(teamset_id, team_name) not in self.user_enrollment_by_team:
self.user_enrollment_by_team[teamset_id, team_name] = set()
self.user_enrollment_by_team[teamset_id, team_name].add(self.user_to_actual_enrollment_mode[user.id])
if self.is_FERPA_bubble_breached(teamset_id, team_name):
if self.is_FERPA_bubble_breached(teamset_id, team_name) or \
not self.is_enrollment_protection_for_existing_team_matches_user(user, team_name, teamset_id):
error_message = \
'Team {} cannot have Masters track users mixed with users in other tracks.'.format(team_name)
self.add_error_and_check_if_max_exceeded(error_message)
return False
if not self.is_enrollment_protection_for_existing_team_matches_user(user, team_name, teamset_id):
error_message = \
'User {} does not have access to team {}.'.format(user.username, team_name)
self.add_error_and_check_if_max_exceeded(error_message)
return False
return True
def is_enrollment_protection_for_existing_team_matches_user(self, user, team_name, teamset_id):

View File

@@ -3101,8 +3101,7 @@ class TestBulkMembershipManagement(TeamAPITestCase):
user='staff'
)
response_text = json.loads(response.content.decode('utf-8'))
expected_message = 'User {} does not have access to team {}.'.format(
masters_a,
expected_message = 'Team {} cannot have Masters track users mixed with users in other tracks.'.format(
team.name
)
self.assertEqual(response_text['errors'][0], expected_message)