From f1835db72a37c743aad8543cb74d80305c725e44 Mon Sep 17 00:00:00 2001 From: MarkLark86 Date: Thu, 18 Apr 2024 09:28:55 +1000 Subject: [PATCH] [TGA-91] fix: Checking presence of ProfileID field if null (#24) --- server/tests/author_profiles_test.py | 2 ++ server/tga/author_profiles.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/tests/author_profiles_test.py b/server/tests/author_profiles_test.py index 0430eb6..152a79c 100644 --- a/server/tests/author_profiles_test.py +++ b/server/tests/author_profiles_test.py @@ -199,6 +199,7 @@ "enabled": True, "required": True, }, + "profile_id": None, }, "schema": { "slugline": { @@ -207,6 +208,7 @@ "maxlength": 24, "nullable": False, }, + "profile_id": None, }, }, { diff --git a/server/tga/author_profiles.py b/server/tga/author_profiles.py index 83f4d68..e4655b6 100644 --- a/server/tga/author_profiles.py +++ b/server/tga/author_profiles.py @@ -32,7 +32,7 @@ def _get_content_profile_custom_fields(original: Dict[str, Any]) -> List[Dict[st return [ field for field in get_resource_service("vocabularies").get_extra_fields() - if field["_id"] in content_profile["schema"].keys() + if (content_profile["editor"].get(field["_id"]) or {}).get("enabled") ]