@@ -52,13 +52,16 @@ def _assert_guid(guid: str):
5252
5353# ContentItem Repository uses a PATCH method, not a PUT for updating.
5454class _ContentItemRepository (_Resource ):
55- def update (self , ** attributes ): # type: ignore[reportIncompatibleMethodOverride]
55+ def update (self , ** attributes ):
5656 response = self ._ctx .client .patch (self ._path , json = attributes )
5757 result = response .json ()
58- super ().update (** result )
58+ # # Calling this method will call `_Resource.update` which will try to PUT to the path.
59+ # super().update(**result)
60+ # Instead, update the dict directly.
61+ dict .update (self , ** result )
5962
6063
61- class ContentItemRepository (ResourceP ):
64+ class ContentItemRepository (ResourceP , Protocol ):
6265 """
6366 Content items GitHub repository information.
6467
@@ -217,9 +220,13 @@ def oauth(self) -> ContentItemOAuth:
217220 @property
218221 def repository (self ) -> ContentItemRepository | None :
219222 try :
223+ path = f"v1/content/{ self ['guid' ]} /repository"
224+ response = self ._ctx .client .get (path )
225+ result = response .json ()
220226 return _ContentItemRepository (
221227 self ._ctx ,
222- f"v1/content/{ self ['guid' ]} /repository" ,
228+ path ,
229+ ** result ,
223230 )
224231 except ClientError :
225232 return None
0 commit comments