Skip to content

Commit

Permalink
Use just resource_prefix if parent is a site
Browse files Browse the repository at this point in the history
When the site class is being built from a parent site the parent main_resource does not need to be used, only the resource_prefix.
  • Loading branch information
jtweeder authored Mar 28, 2019
1 parent 6949960 commit e7bb786
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion O365/sharepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ def __init__(self, *, parent=None, con=None, **kwargs):

# prefix with the current known site
resource_prefix = 'sites/{site_id}'.format(site_id=self.object_id)
main_resource = '{}{}'.format(main_resource, resource_prefix)
main_resource = (resource_prefix if isinstance(parent,Site)
else '{}{}'.format(main_resource, resource_prefix))

super().__init__(
protocol=parent.protocol if parent else kwargs.get('protocol'),
Expand Down

0 comments on commit e7bb786

Please sign in to comment.