diff --git a/socialauth/auth_backends.py b/socialauth/auth_backends.py index 4985a6c..ad2d93b 100644 --- a/socialauth/auth_backends.py +++ b/socialauth/auth_backends.py @@ -6,10 +6,8 @@ import urllib from socialauth.lib import oauthtwitter2 as oauthtwitter from socialauth.models import OpenidProfile as UserAssociation, TwitterUserProfile, FacebookUserProfile, LinkedInUserProfile, AuthMeta -from socialauth.lib.facebook import get_user_info, get_facebook_signature from socialauth.lib.linkedin import * -from datetime import datetime import random TWITTER_CONSUMER_KEY = getattr(settings, 'TWITTER_CONSUMER_KEY', '') diff --git a/socialauth/forms.py b/socialauth/forms.py index 37fc7fe..402f981 100644 --- a/socialauth/forms.py +++ b/socialauth/forms.py @@ -1,5 +1,4 @@ from django import forms -from django.contrib.auth.models import User from django.conf import settings from socialauth.models import AuthMeta diff --git a/socialauth/models.py b/socialauth/models.py index 0c59412..4cc74c4 100644 --- a/socialauth/models.py +++ b/socialauth/models.py @@ -1,7 +1,5 @@ from django.db import models from django.contrib.auth.models import User -from django.db.models.signals import post_save -from django.db import connection, transaction class AuthMeta(models.Model): """Metadata for Authentication""" @@ -80,4 +78,4 @@ class FacebookUserProfile(models.Model): about_me = models.CharField(max_length=160, blank=True, null=True) def __unicode__(self): - return "%s's profile" % self.user \ No newline at end of file + return "%s's profile" % self.user diff --git a/socialauth/tests.py b/socialauth/tests.py index 93f9b85..3707e1e 100644 --- a/socialauth/tests.py +++ b/socialauth/tests.py @@ -1,5 +1,5 @@ from selenium import selenium -import unittest, time, re +import unittest from django.contrib.auth.models import User from test_data import * diff --git a/socialauth/urls.py b/socialauth/urls.py index 9f27f0b..d750f3e 100644 --- a/socialauth/urls.py +++ b/socialauth/urls.py @@ -1,9 +1,7 @@ from django.conf.urls.defaults import * -from openid_consumer.views import begin, complete, signout +from openid_consumer.views import complete, signout from django.views.generic.simple import direct_to_template -from django.conf import settings - #Login Views urlpatterns = patterns('socialauth.views', url(r'^facebook_login/xd_receiver.htm$', direct_to_template, {'template':'socialauth/xd_receiver.htm'}, name='socialauth_xd_receiver'), diff --git a/socialauth/views.py b/socialauth/views.py index 16a5bc2..faf1857 100644 --- a/socialauth/views.py +++ b/socialauth/views.py @@ -1,36 +1,23 @@ import logging import urllib -import random -from re import escape -from datetime import datetime -from cgi import parse_qs from oauth import oauth from django.shortcuts import render_to_response from django.template import RequestContext -from django.contrib.auth.models import UserManager, User from django.contrib.auth import authenticate, login -from django.http import HttpResponseRedirect, HttpResponseForbidden, HttpResponse +from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth.views import logout -from django.utils.translation import ugettext as _ -try: - import json #Works with Python 2.6 -except ImportError: - from django.utils import simplejson as json - -from socialauth.models import OpenidProfile, AuthMeta, FacebookUserProfile, TwitterUserProfile, LinkedInUserProfile +from socialauth.models import AuthMeta from socialauth.forms import EditProfileForm from openid_consumer.views import begin from socialauth.lib import oauthtwitter2 as oauthtwitter -from socialauth.lib import oauthyahoo, oauthgoogle -from socialauth.lib.facebook import get_user_info, get_facebook_signature, \ - get_friends, get_friends_via_fql + from socialauth.lib.linkedin import * LINKEDIN_CONSUMER_KEY = getattr(settings, 'LINKEDIN_CONSUMER_KEY', '')