Skip to content

Commit

Permalink
Merge pull request #11752 from rtibbles/on_my_own_download
Browse files Browse the repository at this point in the history
Turn on learner resource download by default for on my own setup.
  • Loading branch information
rtibbles authored Jan 19, 2024
2 parents ce3bacd + 5e31d02 commit 1a051d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kolibri/core/device/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ def create(self, validated_data): # noqa C901

custom_settings = validated_data.pop("settings")

allow_learner_download_resources = False

if facility_created:
# We only want to update things about the facility or the facility dataset in the case
# that we are creating the facility during this provisioning process.
Expand All @@ -154,6 +156,10 @@ def create(self, validated_data): # noqa C901

if "on_my_own_setup" in custom_settings:
facility.on_my_own_setup = custom_settings.pop("on_my_own_setup")
# If we are in on my own setup, then we want to allow learners to download resources
# to give them a seamless onboarding experience, without the need to use the device
# plugin to download resources en masse.
allow_learner_download_resources = True

# overwrite the settings in dataset_data with validated_data.settings
for key, value in custom_settings.items():
Expand Down Expand Up @@ -227,6 +233,7 @@ def create(self, validated_data): # noqa C901
"language_id": language_id,
"default_facility": facility,
"allow_guest_access": allow_guest_access,
"allow_learner_download_resources": allow_learner_download_resources,
}

if is_soud:
Expand Down

0 comments on commit 1a051d4

Please sign in to comment.