From 1bda2142cd4a11b191cf5643dd02298719416681 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Tue, 6 Oct 2015 17:37:05 +0200 Subject: [PATCH] Updates to manage.py Tweaks to node_type comments validation code. --- pillar/manage.py | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/pillar/manage.py b/pillar/manage.py index 80562ce2..c6ae084a 100644 --- a/pillar/manage.py +++ b/pillar/manage.py @@ -697,22 +697,25 @@ def populate_node_types(old_ids={}): }, # Collection of ratings, keyed by user 'ratings': { - 'type': 'dict', + 'type': 'list', 'schema': { - 'user': { - 'type': 'objectid' - }, - 'is_positive': { - 'type': 'boolean' - }, - # Weight of the rating based on user rep and the context. - # Currently we have the following weights: - # - 1 auto null - # - 2 manual null - # - 3 auto valid - # - 4 manual valid - 'weight': { - 'type': 'integer' + 'type': 'dict', + 'schema': { + 'user': { + 'type': 'objectid' + }, + 'is_positive': { + 'type': 'boolean' + }, + # Weight of the rating based on user rep and the context. + # Currently we have the following weights: + # - 1 auto null + # - 2 manual null + # - 3 auto valid + # - 4 manual valid + 'weight': { + 'type': 'integer' + } } } }, @@ -726,13 +729,7 @@ def populate_node_types(old_ids={}): 'status': {}, 'rating_positive': {}, 'rating_negative': {}, - 'ratings': { - 'schema': { - 'user': {}, - 'is_positive': {}, - 'weight': {} - } - }, + 'ratings': {}, 'confidence': {} }, 'parent': {