From 32300b88a0759f366c16c66a1bab41d8f34fa501 Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Fri, 20 Sep 2024 18:21:41 +0200 Subject: [PATCH] Refactor social account configuration in SchemingDCATPlugin --- ckanext/schemingdcat/plugin.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/ckanext/schemingdcat/plugin.py b/ckanext/schemingdcat/plugin.py index a9be6e22..3831835a 100644 --- a/ckanext/schemingdcat/plugin.py +++ b/ckanext/schemingdcat/plugin.py @@ -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()