def update(self, instance, validated_data): course_run_key = instance.id _id = validated_data.pop('id') team = validated_data.pop('team', []) user = self.context['request'].user fields = { 'display_name': instance.display_name } fields.update(validated_data) new_course_run_key = rerun_course(user, course_run_key, course_run_key.org, course_run_key.course, _id['run'], fields, async=False) course_run = get_course_and_check_access(new_course_run_key, user) self.update_team(course_run, team) return course_run
def update(self, instance, validated_data): course_run_key = instance.id _id = validated_data.pop('id') team = validated_data.pop('team', []) user = self.context['request'].user fields = {'display_name': instance.display_name} fields.update(validated_data) new_course_run_key = rerun_course(user, course_run_key, course_run_key.org, course_run_key.course, _id['run'], fields, False) course_run = get_course_and_check_access(new_course_run_key, user) self.update_team(course_run, team) return course_run