Skip to content

Commit 982f54f

Browse files
author
Gauvain Pocentek
committed
Merge branch 'rhansen-fix-json'
2 parents 3f38689 + 26d73e2 commit 982f54f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gitlab/objects.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@
3131

3232
class jsonEncoder(json.JSONEncoder):
3333
def default(self, obj):
34+
from gitlab import Gitlab
3435
if isinstance(obj, GitlabObject):
35-
return obj.__dict__
36+
return {k: v for k, v in obj.__dict__.iteritems()
37+
if not isinstance(v, BaseManager)}
3638
elif isinstance(obj, Gitlab):
3739
return {'url': obj._url}
3840
return json.JSONEncoder.default(self, obj)
@@ -474,7 +476,7 @@ def json(self):
474476
Returns:
475477
str: The json string.
476478
"""
477-
return json.dumps(self.__dict__, cls=jsonEncoder)
479+
return json.dumps(self, cls=jsonEncoder)
478480

479481

480482
class UserKey(GitlabObject):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy