Skip to content

Commit

Permalink
Update src/posit/connect/content.py
Browse files Browse the repository at this point in the history
Co-authored-by: Neal Richardson <[email protected]>
  • Loading branch information
tdstein and nealrichardson authored Jun 13, 2024
1 parent bc956ed commit f20aefe
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/posit/connect/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ def permissions(self) -> Permissions:

@property
def owner(self) -> ContentItemOwner:
if "owner" in self:
return self["owner"]
user = Users(self.config, self.session).get(self.owner_guid)
owner = ContentItemOwner(self.config, self.session, **user)
return owner
if "owner" not in self:
# It is possible to get a content item that does not contain owner.
# "owner" is an optional additional request param.
# If it's not included, we can retrieve the information by `owner_guid`
self["owner"] = Users(self.config, self.session).get(self.owner_guid)
return ContentItemOwner(self.config, self.session, **self["owner"])

# Properties

Expand Down

0 comments on commit f20aefe

Please sign in to comment.