File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -491,6 +491,14 @@ def as_dict(self):
491491 return {k : v for k , v in six .iteritems (self .__dict__ )
492492 if (not isinstance (v , BaseManager ) and not k [0 ] == '_' )}
493493
494+ def __eq__ (self , other ):
495+ if type (other ) is type (self ):
496+ return self .as_dict () == other .as_dict ()
497+ return False
498+
499+ def __ne__ (self , other ):
500+ return not self .__eq__ (other )
501+
494502
495503class UserKey (GitlabObject ):
496504 _url = '/users/%(user_id)s/keys'
@@ -544,6 +552,15 @@ def unblock(self, **kwargs):
544552 raise_error_from_response (r , GitlabUnblockError )
545553 self .state = 'active'
546554
555+ def __eq__ (self , other ):
556+ if type (other ) is type (self ):
557+ selfdict = self .as_dict ()
558+ otherdict = other .as_dict ()
559+ selfdict .pop (u'password' , None )
560+ otherdict .pop (u'password' , None )
561+ return selfdict == otherdict
562+ return False
563+
547564
548565class UserManager (BaseManager ):
549566 obj_cls = User
You can’t perform that action at this time.
0 commit comments