You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ariatosca.apache.org by mx...@apache.org on 2017/12/03 11:47:50 UTC
[incubator-ariatosca] branch
ARIA-417-Encoding-models-to-json-is-too-strict updated (01fe7e6 -> 3988661)
This is an automated email from the ASF dual-hosted git repository.
mxmrlv pushed a change to branch ARIA-417-Encoding-models-to-json-is-too-strict
in repository https://gitbox.apache.org/repos/asf/incubator-ariatosca.git.
discard 01fe7e6 a more generic support to json encoding
new 3988661 ARIA-417 Encoding models to json is too strict
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (01fe7e6)
\
N -- N -- N refs/heads/ARIA-417-Encoding-models-to-json-is-too-strict (3988661)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
--
To stop receiving notification emails like this one, please contact
['"commits@ariatosca.apache.org" <co...@ariatosca.apache.org>'].
[incubator-ariatosca] 01/01: ARIA-417 Encoding models to json is
too strict
Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mxmrlv pushed a commit to branch ARIA-417-Encoding-models-to-json-is-too-strict
in repository https://gitbox.apache.org/repos/asf/incubator-ariatosca.git
commit 398866109e6d493000e4bab7e6369c495c427eb1
Author: max-orlov <ma...@gigaspaces.com>
AuthorDate: Tue Nov 28 17:24:31 2017 +0200
ARIA-417 Encoding models to json is too strict
---
aria/modeling/utils.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/aria/modeling/utils.py b/aria/modeling/utils.py
index 6e851f2..72fd51f 100644
--- a/aria/modeling/utils.py
+++ b/aria/modeling/utils.py
@@ -36,14 +36,13 @@ class ModelJSONEncoder(JSONEncoder):
super(ModelJSONEncoder, self).__init__(*args, **kwargs)
def default(self, o): # pylint: disable=method-hidden
- from .mixins import ModelMixin
- if isinstance(o, ModelMixin):
+ try:
if hasattr(o, 'value'):
dict_to_return = o.to_dict(fields=('value',))
return dict_to_return['value']
else:
return o.to_dict()
- else:
+ except:
return JSONEncoder.default(self, o)
--
To stop receiving notification emails like this one, please contact
"commits@ariatosca.apache.org" <co...@ariatosca.apache.org>.