Skip to content

Commit

Permalink
oauth: gitlab: prevent duplicate entries after sync
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitKnecht committed Jun 20, 2016
1 parent cf5c47c commit 2356d84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions readthedocs/oauth/services/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ def is_owned_by(owner_id):
if privacy == 'private' or (repo_is_public and privacy == 'public'):
try:
repo = RemoteRepository.objects.get(
full_name=fields['name'],
full_name=fields['name_with_namespace'],
users=self.user,
account=self.account,
)
except RemoteRepository.DoesNotExist:
repo = RemoteRepository.objects.create(
full_name=fields['name'],
full_name=fields['name_with_namespace'],
account=self.account,
)
repo.users.add(self.user)
Expand Down

0 comments on commit 2356d84

Please sign in to comment.