Skip to content

Commit

Permalink
Don't return invalid directories if they're in the options.ini file
Browse files Browse the repository at this point in the history
  • Loading branch information
José Redrejo committed Nov 23, 2022
1 parent 70ae22e commit d644571
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kolibri/core/device/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from kolibri.deployment.default.sqlite_db_names import SYNC_QUEUE
from kolibri.plugins.app.utils import interface
from kolibri.utils.conf import OPTIONS
from kolibri.utils.filesystem import check_is_directory
from kolibri.utils.options import update_options_file

device_permissions_fields = ["is_superuser", "can_manage_content"]
Expand Down Expand Up @@ -168,7 +169,9 @@ def primary_storage_location(self, value):

@property
def secondary_storage_locations(self):
return OPTIONS["Paths"]["CONTENT_FALLBACK_DIRS"]
return list(
filter(check_is_directory, OPTIONS["Paths"]["CONTENT_FALLBACK_DIRS"])
)

@secondary_storage_locations.setter
def secondary_storage_locations(self, value):
Expand Down

0 comments on commit d644571

Please sign in to comment.