summaryrefslogtreecommitdiff
path: root/gitlab/objects.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-01-23 16:26:13 +0100
committerGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-01-23 16:26:13 +0100
commit982f54fb174f23e60ed40577af2d62f281d83c10 (patch)
tree8c980b3e827c9e340c3459e39b0bdc64adf6309d /gitlab/objects.py
parent3f386891ecf15ac4f0da34bdda59cf8e8d2f6ff0 (diff)
parent26d73e2828db89f9464c291de7607b7e78c58ca4 (diff)
downloadgitlab-982f54fb174f23e60ed40577af2d62f281d83c10.tar.gz
Merge branch 'rhansen-fix-json'
Diffstat (limited to 'gitlab/objects.py')
-rw-r--r--gitlab/objects.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py
index d0e05ea..9f3a655 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -31,8 +31,10 @@ from gitlab.exceptions import * # noqa
class jsonEncoder(json.JSONEncoder):
def default(self, obj):
+ from gitlab import Gitlab
if isinstance(obj, GitlabObject):
- return obj.__dict__
+ return {k: v for k, v in obj.__dict__.iteritems()
+ if not isinstance(v, BaseManager)}
elif isinstance(obj, Gitlab):
return {'url': obj._url}
return json.JSONEncoder.default(self, obj)
@@ -474,7 +476,7 @@ class GitlabObject(object):
Returns:
str: The json string.
"""
- return json.dumps(self.__dict__, cls=jsonEncoder)
+ return json.dumps(self, cls=jsonEncoder)
class UserKey(GitlabObject):