From a479bd405a828f42408663aaa360c52e128b9d3b Mon Sep 17 00:00:00 2001 From: Marco Marche Date: Tue, 25 Mar 2014 22:16:41 +0100 Subject: [PATCH 1/2] added support for custom user class --- twython_django_oauth/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/twython_django_oauth/models.py b/twython_django_oauth/models.py index 3319d40..bb9ce71 100644 --- a/twython_django_oauth/models.py +++ b/twython_django_oauth/models.py @@ -1,5 +1,7 @@ from django.db import models -from django.contrib.auth.models import User +from django.contrib.auth import get_user_model + +User = get_user_model() class TwitterProfile(models.Model): From d4355c3809a46c291910175185a9e6cd05e57715 Mon Sep 17 00:00:00 2001 From: Marco Marche Date: Tue, 25 Mar 2014 22:16:41 +0100 Subject: [PATCH 2/2] added support for custom user class --- twython_django_oauth/models.py | 4 +++- twython_django_oauth/views.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/twython_django_oauth/models.py b/twython_django_oauth/models.py index 3319d40..bb9ce71 100644 --- a/twython_django_oauth/models.py +++ b/twython_django_oauth/models.py @@ -1,5 +1,7 @@ from django.db import models -from django.contrib.auth.models import User +from django.contrib.auth import get_user_model + +User = get_user_model() class TwitterProfile(models.Model): diff --git a/twython_django_oauth/views.py b/twython_django_oauth/views.py index b171adc..d2c942e 100644 --- a/twython_django_oauth/views.py +++ b/twython_django_oauth/views.py @@ -1,5 +1,5 @@ from django.contrib.auth import authenticate, login, logout as django_logout -from django.contrib.auth.models import User +from django.contrib.auth import get_user_model from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.conf import settings @@ -7,6 +7,9 @@ from django.core.urlresolvers import reverse from twython import Twython +User = get_user_model() + + # If you've got your own Profile setup, see the note in the models file # about adapting this to your own setup. from twython_django_oauth.models import TwitterProfile