Skip to content

Commit

Permalink
Refactor social account configuration in SchemingDCATPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mjanez committed Sep 20, 2024
1 parent 1e504ca commit 32300b8
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions ckanext/schemingdcat/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,17 @@ def update_config(self, config_):
)

# Social accounts
sdct_config.social_github = helpers.schemingdcat_check_valid_url(
config_.get(
"schemingdcat.social_github"
)
) or sdct_config.social_github

sdct_config.social_x = helpers.schemingdcat_check_valid_url(
config_.get(
"schemingdcat.social_x"
)
) or sdct_config.social_x
sdct_config.social_github = config_.get(
"schemingdcat.social_github", sdct_config.social_github
) or sdct_config.social_github

sdct_config.social_linkedin = helpers.schemingdcat_check_valid_url(
config_.get(
"schemingdcat.social_linkedin"
)
) or sdct_config.social_linkedin
sdct_config.social_linkedin = config_.get(
"schemingdcat.social_linkedin", sdct_config.social_linkedin
) or sdct_config.social_linkedin

sdct_config.social_x = config_.get(
"schemingdcat.social_x", sdct_config.social_x
) or sdct_config.social_x

# Load yamls config files
init_config()
Expand Down

0 comments on commit 32300b8

Please sign in to comment.