Allow self-registration on meetings and cleans

This commit is contained in:
Tanner Collin 2023-05-23 03:10:06 +00:00
parent 0f2fad7209
commit a94918a8ed

View File

@ -456,8 +456,9 @@ class TrainingViewSet(Base, Retrieve, Create, Update):
member = get_object_or_404(models.Member, id=data['member_id']) member = get_object_or_404(models.Member, id=data['member_id'])
user = member.user user = member.user
course_id = session.course.id
if user == session.instructor: if course_id not in [317, 273, 413] and user == session.instructor:
msg = 'Self-register trickery detected:\n' + str(data.dict()) msg = 'Self-register trickery detected:\n' + str(data.dict())
utils.alert_tanner(msg) utils.alert_tanner(msg)
raise exceptions.ValidationError(dict(non_field_errors='Can\'t register the instructor. Don\'t try to trick the portal.')) raise exceptions.ValidationError(dict(non_field_errors='Can\'t register the instructor. Don\'t try to trick the portal.'))