Added in validation for each of the 3 fields that should not be changed if the instance is a container group, defaults in the textarea persist with these 3 options

This commit is contained in:
Rebeccah
2019-10-15 17:36:55 -04:00
committed by Ryan Petrello
parent 71d7bac261
commit d25e6249fd
3 changed files with 24 additions and 1 deletions

View File

@@ -366,6 +366,10 @@ def get_allowed_fields(obj, serializer_mapping):
field_blacklist = ACTIVITY_STREAM_FIELD_EXCLUSIONS.get(obj._meta.model_name, [])
if field_blacklist:
allowed_fields = [f for f in allowed_fields if f not in field_blacklist]
# raise Exception(_("please render this"))
# if obj.__class__.__name__ == 'InstanceGroup' and obj.is_containerized:
# container_group_blacklist = ["policy_instance_percentage", "policy_instance_minimum", "policy_instance_list"]
# allowed_fields = [f for f in allowed_fields if f not in container_group_blacklist]
return allowed_fields