Temp fixes for Dillo integration
This commit is contained in:
@@ -13,7 +13,8 @@ from pillar.web.utils import pretty_date
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
blueprint = Blueprint('nodes_api', __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('/<node_id>/share', methods=['GET', 'POST'])
|
@blueprint.route('/<node_id>/share', methods=['GET', 'POST'])
|
||||||
|
@@ -50,6 +50,7 @@ def iter_node_properties(node_type):
|
|||||||
@functools.lru_cache(maxsize=1)
|
@functools.lru_cache(maxsize=1)
|
||||||
def tag_choices() -> typing.List[typing.Tuple[str, str]]:
|
def tag_choices() -> typing.List[typing.Tuple[str, str]]:
|
||||||
"""Return (value, label) tuples for the NODE_TAGS config setting."""
|
"""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 []
|
tags = current_app.config.get('NODE_TAGS') or []
|
||||||
return [(tag, tag.title()) for tag in tags] # (value, label) tuples
|
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
|
# Recursive call if detects a dict
|
||||||
field_type = schema_prop['type']
|
field_type = schema_prop['type']
|
||||||
|
|
||||||
if prop_name == 'tags' and field_type == 'list':
|
if field_type == 'dict':
|
||||||
field = SelectMultipleField(choices=tag_choices())
|
|
||||||
elif field_type == 'dict':
|
|
||||||
assert prop_name == 'attachments'
|
assert prop_name == 'attachments'
|
||||||
field = attachments.attachment_form_group_create(schema_prop)
|
field = attachments.attachment_form_group_create(schema_prop)
|
||||||
elif field_type == 'list':
|
elif field_type == 'list':
|
||||||
|
Reference in New Issue
Block a user