diff --git a/server/planning/content_profiles/utils.py b/server/planning/content_profiles/utils.py index f74440c0b..c753a9df8 100644 --- a/server/planning/content_profiles/utils.py +++ b/server/planning/content_profiles/utils.py @@ -46,14 +46,12 @@ def get_multilingual_fields(resource: str) -> Set[str]: ) ) + def get_editor3_fields(resource: str) -> Set[str]: content_type = get_planning_schema(resource) resource_schema = content_type.get("schema") or {} return set( field_name for field_name, field_schema in resource_schema.items() - if ( - is_field_enabled(field_name, content_type) - and ((field_schema or {})).get("field_type", "") == "editor_3" + if (is_field_enabled(field_name, content_type) and ((field_schema or {})).get("field_type", "") == "editor_3") ) - ) diff --git a/server/planning/feed_parsers/utils.py b/server/planning/feed_parsers/utils.py index 3062dc7a7..7e84f955a 100644 --- a/server/planning/feed_parsers/utils.py +++ b/server/planning/feed_parsers/utils.py @@ -29,9 +29,6 @@ def parse_duration(value: str) -> datetime.timedelta: return datetime.timedelta(**kwargs) raise ValueError(f"Could not parse duration string {value!r}") + def upgrade_rich_text_fields(item: Dict[str, Any], resource: str): - item.update({ - field: plain_text_to_html(item[field]) - for field in get_editor3_fields(resource) - if item.get(field) - }) \ No newline at end of file + item.update({field: plain_text_to_html(item[field]) for field in get_editor3_fields(resource) if item.get(field)})