@@ -44,10 +44,10 @@ def get_id(self) -> int:
4444 """Returns the id of the resource. This override deals with
4545 the fact that either an `id` or a `target_project_id` attribute
4646 is returned by the server depending on the endpoint called."""
47- try :
48- return cast ( int , getattr ( self , self . _id_attr ))
49- except AttributeError :
50- return cast (int , self .id )
47+ project_id = cast ( int , super (). get_id ())
48+ if project_id is not None :
49+ return project_id
50+ return cast (int , self .id )
5151
5252
5353class AllowlistProjectManager (ListMixin , CreateMixin , DeleteMixin , RESTManager ):
@@ -64,10 +64,10 @@ def get_id(self) -> int:
6464 """Returns the id of the resource. This override deals with
6565 the fact that either an `id` or a `target_group_id` attribute
6666 is returned by the server depending on the endpoint called."""
67- try :
68- return cast ( int , getattr ( self , self . _id_attr ))
69- except AttributeError :
70- return cast (int , self .id )
67+ group_id = cast ( int , super (). get_id ())
68+ if group_id is not None :
69+ return group_id
70+ return cast (int , self .id )
7171
7272
7373class AllowlistGroupManager (ListMixin , CreateMixin , DeleteMixin , RESTManager ):
0 commit comments