Skip to content

Commit

Permalink
Don't use login on get_or_create.
Browse files Browse the repository at this point in the history
It breaks with an IntegrityError when a user changes their login.
  • Loading branch information
matthewcburke committed Jul 27, 2015
1 parent 8ebfe50 commit 0dc66b6
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions github_users/github_users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def _add_followers(self, data):
now = datetime.datetime.now(tz=pytz.UTC)
follower, created = GitHubUser.objects.get_or_create(
github_id=user['id'],
login=user['login'],
defaults={'last_retrieved': now, 'last_checked': now}
)
if follower not in followers:
Expand Down Expand Up @@ -134,7 +133,6 @@ def _add_following(self, data):
now = datetime.datetime.now(tz=pytz.UTC)
gh_user, created = GitHubUser.objects.get_or_create(
github_id=user['id'],
login=user['login'],
defaults={'last_retrieved': now, 'last_checked': now}
)
if gh_user not in following:
Expand Down

0 comments on commit 0dc66b6

Please sign in to comment.