* Check learner enrollment status to avoid mixing learners from incompatible tracks (e.g. masters/audit) to the same team * When a new team is encountered on a team management CSV, create it with the protection status of the user
37 lines
967 B
Python
37 lines
967 B
Python
"""
|
|
Errors thrown in the Team API.
|
|
"""
|
|
|
|
|
|
class TeamAPIRequestError(Exception):
|
|
"""There was a problem with a request to the Team API."""
|
|
pass
|
|
|
|
|
|
class NotEnrolledInCourseForTeam(TeamAPIRequestError):
|
|
"""User is not enrolled in the course for the team they are trying to join."""
|
|
pass
|
|
|
|
|
|
class AlreadyOnTeamInCourse(TeamAPIRequestError):
|
|
"""User is already a member of another team in the same course."""
|
|
pass
|
|
|
|
|
|
class AddToIncompatibleTeamError(TeamAPIRequestError):
|
|
"""
|
|
User is enrolled in a mode that is incompatible with this team type.
|
|
e.g. Masters learners cannot be placed in a team with audit learners
|
|
"""
|
|
pass
|
|
|
|
|
|
class ElasticSearchConnectionError(TeamAPIRequestError):
|
|
"""The system was unable to connect to the configured elasticsearch instance."""
|
|
pass
|
|
|
|
|
|
class ImmutableMembershipFieldException(Exception):
|
|
"""An attempt was made to change an immutable field on a CourseTeamMembership model."""
|
|
pass
|