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):
491
491
return {k : v for k , v in six .iteritems (self .__dict__ )
492
492
if (not isinstance (v , BaseManager ) and not k [0 ] == '_' )}
493
493
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
+
494
502
495
503
class UserKey (GitlabObject ):
496
504
_url = '/users/%(user_id)s/keys'
@@ -544,6 +552,15 @@ def unblock(self, **kwargs):
544
552
raise_error_from_response (r , GitlabUnblockError )
545
553
self .state = 'active'
546
554
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
+
547
564
548
565
class UserManager (BaseManager ):
549
566
obj_cls = User
You can’t perform that action at this time.
0 commit comments