From 0dc66b6e2f28ba51b193c56e71b2473bcc497daf Mon Sep 17 00:00:00 2001 From: Matthew Burke Date: Mon, 27 Jul 2015 09:51:38 -0700 Subject: [PATCH] Don't use login on get_or_create. It breaks with an IntegrityError when a user changes their login. --- github_users/github_users/models.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/github_users/github_users/models.py b/github_users/github_users/models.py index 70abc9e..890692a 100644 --- a/github_users/github_users/models.py +++ b/github_users/github_users/models.py @@ -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: @@ -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: