Skip to content

Commit

Permalink
Allow to import public repositories on corporate site
Browse files Browse the repository at this point in the history
When the DEFAULT_PRIVACY_LEVEL is ``private`` we allow to import
public _and_ private repositories from Bitbucket service.
  • Loading branch information
humitos committed Jan 22, 2018
1 parent 1af4441 commit f5e8987
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions readthedocs/oauth/services/bitbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ def create_repository(self, fields, privacy=DEFAULT_PRIVACY_LEVEL,
:type organization: RemoteOrganization
:rtype: RemoteRepository
"""
if (fields['is_private'] is True and privacy == 'private' or
fields['is_private'] is False and privacy == 'public'):
if (
(privacy == 'private') or
(fields['is_private'] is False and privacy == 'public')
):
repo, _ = RemoteRepository.objects.get_or_create(
full_name=fields['full_name'],
account=self.account,
Expand Down

0 comments on commit f5e8987

Please sign in to comment.