From 6b6a5310f894ec809f40c490b89c2336394586c5 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Fri, 1 Feb 2019 19:49:58 +0100 Subject: [PATCH] Temp fixes for Dillo integration --- pillar/api/nodes/__init__.py | 3 ++- pillar/web/nodes/forms.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pillar/api/nodes/__init__.py b/pillar/api/nodes/__init__.py index c3f76389..f8be2a44 100644 --- a/pillar/api/nodes/__init__.py +++ b/pillar/api/nodes/__init__.py @@ -13,7 +13,8 @@ from pillar.web.utils import pretty_date log = logging.getLogger(__name__) blueprint = Blueprint('nodes_api', __name__) -ROLES_FOR_SHARING = ROLES_FOR_COMMENTING ={'subscriber', 'demo'} +# TODO(fsiddi) Propose changes to make commenting roles a configuration value. +ROLES_FOR_SHARING = ROLES_FOR_COMMENTING = set() @blueprint.route('//share', methods=['GET', 'POST']) diff --git a/pillar/web/nodes/forms.py b/pillar/web/nodes/forms.py index ebb32a3b..ab7a5a9e 100644 --- a/pillar/web/nodes/forms.py +++ b/pillar/web/nodes/forms.py @@ -50,6 +50,7 @@ def iter_node_properties(node_type): @functools.lru_cache(maxsize=1) def tag_choices() -> typing.List[typing.Tuple[str, str]]: """Return (value, label) tuples for the NODE_TAGS config setting.""" + #TODO(fsiddi) consider allowing tags based on custom_properties in the project. tags = current_app.config.get('NODE_TAGS') or [] return [(tag, tag.title()) for tag in tags] # (value, label) tuples @@ -70,9 +71,7 @@ def add_form_properties(form_class, node_type): # Recursive call if detects a dict field_type = schema_prop['type'] - if prop_name == 'tags' and field_type == 'list': - field = SelectMultipleField(choices=tag_choices()) - elif field_type == 'dict': + if field_type == 'dict': assert prop_name == 'attachments' field = attachments.attachment_form_group_create(schema_prop) elif field_type == 'list':