corrected linting errors and a minor bug in cf_to_string

This commit is contained in:
Raymond Kuiper 2025-09-12 14:39:11 +02:00
parent bc12064b6a
commit c27505b927
3 changed files with 13 additions and 14 deletions

View File

@ -55,9 +55,8 @@ def cf_to_string(cf, key="name", logger=None):
Converts a dict custom fields to string Converts a dict custom fields to string
""" """
if isinstance(cf, dict): if isinstance(cf, dict):
if key: if key in cf:
return cf[key] return cf[key]
else:
logger.error("Conversion of custom field failed, '%s' not found in cf dict.", key) logger.error("Conversion of custom field failed, '%s' not found in cf dict.", key)
return None return None
return cf return cf