Skip to content

Commit

Permalink
[TGA-91] fix: Checking presence of ProfileID field if null (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkLark86 authored Apr 17, 2024
1 parent 8225bcd commit f1835db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions server/tests/author_profiles_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"enabled": True,
"required": True,
},
"profile_id": None,
},
"schema": {
"slugline": {
Expand All @@ -207,6 +208,7 @@
"maxlength": 24,
"nullable": False,
},
"profile_id": None,
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion server/tga/author_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
]


Expand Down

0 comments on commit f1835db

Please sign in to comment.