Skip to content

Commit

Permalink
Don't use a default for yaml config files unless appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Oct 15, 2024
1 parent 21a527f commit 0403674
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 1.30.1

### Bug Fixes

- Don't use a default for yaml config files except .large_image_config.yaml ([#1685](../../pull/1685))

## 1.30.0

### Features
Expand Down
7 changes: 5 additions & 2 deletions girder/girder_large_image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,17 @@ def adjustConfigForUser(config, user):
return config


def addSettingsToConfig(config, user):
def addSettingsToConfig(config, user, name=None):
"""
Add the settings for showing thumbnails and images in item lists to a
config file if the itemList or itemListDialog options are not set.
:param config: the config dictionary to modify.
:param user: the current user.
:param name: the name of the config file.
"""
if name and name != '.large_image_config.yaml':
return
columns = []

showThumbnails = Setting().get(constants.PluginSettings.LARGE_IMAGE_SHOW_THUMBNAILS)
Expand Down Expand Up @@ -596,7 +599,7 @@ def yamlConfigFile(folder, name, user):
folder = Folder().load(folder['parentId'], user=user, level=AccessType.READ)

addConfig = {} if addConfig is None else addConfig
addSettingsToConfig(addConfig, user)
addSettingsToConfig(addConfig, user, name)
return addConfig


Expand Down

0 comments on commit 0403674

Please sign in to comment.