Skip to content
Snippets Groups Projects
Commit 3a1fc3d4 authored by Dominik Seeger's avatar Dominik Seeger :ghost: Committed by robinwilliam.hundt
Browse files

fixed active student accounts getting disabled while import

Student accounts will now be enabled by default when in exercise mode
parent 3dd4f034
No related branches found
No related tags found
1 merge request!219Resolve "Disable login single-login restriction for weekly exercises"
Pipeline #118301 passed
......@@ -2,6 +2,7 @@ import json
import os
import readline
import logging
import constance
from rest_framework.exceptions import ValidationError
from util.messages import warn
......@@ -12,7 +13,7 @@ from util.factories import GradyUserFactory
import semver
log = logging.getLogger(__name__)
config = constance.config
WELCOME = r'''
______ __ ____ __
......@@ -128,7 +129,8 @@ def parse_and_import_hektor_json(exam_data):
raise ValidationError(f"Updated submission type: {submission_type['name']}")
for student in exam_data['students']:
student_obj = user_factory.make_student(exam=exam, is_active=False,
# student accounts will be automatically enabled when in exercise mode
student_obj = user_factory.make_student(exam=exam, is_active=config.EXERCISE_MODE,
**student).student
for submission_obj in student['submissions']:
add_submission(student_obj, **submission_obj)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment