]> git.parisson.com Git - django-social-auth.git/commitdiff
Non-backward compatible URL name changes. Closes gh-95
authorMatías Aguirre <matiasaguirre@gmail.com>
Sun, 3 Jul 2011 20:18:52 +0000 (17:18 -0300)
committerMatías Aguirre <matiasaguirre@gmail.com>
Sun, 3 Jul 2011 20:18:52 +0000 (17:18 -0300)
example/templates/done.html
example/templates/home.html
social_auth/tests/facebook.py
social_auth/tests/google.py
social_auth/tests/twitter.py
social_auth/urls.py
social_auth/views.py

index 4084a982ad63911720be92c0b4cc33c93237a55e..74e2c34a3b8bf024f3dccac99a560fce6f8d5908 100644 (file)
@@ -21,7 +21,7 @@
   <ul>
   {% for account in accounts %}
     <li>
-        <span class="disconnect"><a href={% url disconnect_individual account.provider account.id %}>{{ account.provider|title }} (ID {{ account.id }})</a></span>
+        <span class="disconnect"><a href={% url socialauth_disconnect_individual account.provider account.id %}>{{ account.provider|title }} (ID {{ account.id }})</a></span>
     </li>
   {% endfor %}
   </ul>
   <h3>Associate new OAuth credentials:</h3>
   <ul>
     <li>
-      <a rel="nofollow" href="{% url associate_begin "twitter" %}">Twitter</a>
+      <a rel="nofollow" href="{% url socialauth_associate_begin "twitter" %}">Twitter</a>
     </li>
     <li>
-      <a rel="nofollow" href="{% url associate_begin "facebook" %}">Facebook</a>
+      <a rel="nofollow" href="{% url socialauth_associate_begin "facebook" %}">Facebook</a>
     </li>
     <li>
-      <a rel="nofollow" href="{% url associate_begin "linkedin" %}">LinkedIn</a>
+      <a rel="nofollow" href="{% url socialauth_associate_begin "linkedin" %}">LinkedIn</a>
     </li>
     <li>
-      <a rel="nofollow" href="{% url associate_begin "orkut" %}">Orkut</a>
+      <a rel="nofollow" href="{% url socialauth_associate_begin "orkut" %}">Orkut</a>
     </li>
     <li>
-      <a rel="nofollow" href="{% url associate_begin "google-oauth" %}">Google OAuth</a>
+      <a rel="nofollow" href="{% url socialauth_associate_begin "google-oauth" %}">Google OAuth</a>
     </li>
   </ul>
 
   <h3>Associate new OAuth2 credentials:</h3>
   <ul>
     <li>
-      <a rel="nofollow" href="{% url associate_begin "google-oauth2" %}">Google OAuth2</a>
+      <a rel="nofollow" href="{% url socialauth_associate_begin "google-oauth2" %}">Google OAuth2</a>
     </li>
     <li>
-      <a rel="nofollow" href="{% url associate_begin "foursquare" %}">Foursquare</a>
+      <a rel="nofollow" href="{% url socialauth_associate_begin "foursquare" %}">Foursquare</a>
     </li>
   </ul>
 
   <h3>Associate new OpenID credentials:</h3>
   <ul>
     <li>
-      <a rel="nofollow" href="{% url associate_begin "google" %}">Google OpenID</a>
+      <a rel="nofollow" href="{% url socialauth_associate_begin "google" %}">Google OpenID</a>
     </li>
     <li>
-      <a rel="nofollow" href="{% url associate_begin "yahoo" %}">Yahoo</a>
+      <a rel="nofollow" href="{% url socialauth_associate_begin "yahoo" %}">Yahoo</a>
     </li>
     <li>
-      <form action="{% url associate_begin "livejournal" %}" method="post">{% csrf_token %}
+      <form action="{% url socialauth_associate_begin "livejournal" %}" method="post">{% csrf_token %}
         <div>
           <label for="openid_lj_user">LiveJournal user
           </label>
@@ -75,7 +75,7 @@
       </form>
     </li>
     <li>
-      <form action="{% url associate_begin "openid" %}" method="post">{% csrf_token %}
+      <form action="{% url socialauth_associate_begin "openid" %}" method="post">{% csrf_token %}
         <div>
           <label for="openid_identifier">Other provider:</label>
           <input id="openid_identifier" type="text" value="" name="openid_identifier" />
index 8555a50ac347f6f252e05d1b3c4d3a8fbbae35f7..14b0edf38102a9112842e02448a02e1b999bbc06 100644 (file)
@@ -6,29 +6,29 @@
 <div>
   <h3>Login using <a href="http://oauth.net/" title="OAuth">OAuth</a> from:</h3>
   <ul>
-    <li><a rel="nofollow" href="{% url begin "twitter" %}">Twitter</a></li>
-    <li><a rel="nofollow" href="{% url begin "facebook" %}">Facebook</a></li>
-    <li><a rel="nofollow" href="{% url begin "linkedin" %}">Linkedin</a></li>
-    <li><a rel="nofollow" href="{% url begin "orkut" %}">Orkut</a></li>
-    <li><a rel="nofollow" href="{% url begin "google-oauth" %}">Google OAuth</a></li>
+    <li><a rel="nofollow" href="{% url socialauth_begin "twitter" %}">Twitter</a></li>
+    <li><a rel="nofollow" href="{% url socialauth_begin "facebook" %}">Facebook</a></li>
+    <li><a rel="nofollow" href="{% url socialauth_begin "linkedin" %}">Linkedin</a></li>
+    <li><a rel="nofollow" href="{% url socialauth_begin "orkut" %}">Orkut</a></li>
+    <li><a rel="nofollow" href="{% url socialauth_begin "google-oauth" %}">Google OAuth</a></li>
   </ul>
 </div>
 
 <div>
   <h3>Login using <a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-10" title="OAuth2">OAuth2</a> from:</h3>
   <ul>
-    <li><a rel="nofollow" href="{% url begin "google-oauth2" %}">Google OAuth2</a></li>
-    <li><a rel="nofollow" href="{% url begin "foursquare" %}">Foursquare</a></li>
+    <li><a rel="nofollow" href="{% url socialauth_begin "google-oauth2" %}">Google OAuth2</a></li>
+    <li><a rel="nofollow" href="{% url socialauth_begin "foursquare" %}">Foursquare</a></li>
   </ul>
 </div>
 
 <div>
   <h3>Login using <a href="http://openid.net/" title="OpenId">OpenId</a> from:</h3>
   <ul>
-    <li><a rel="nofollow" href="{% url begin "google" %}">Google</a></li>
-    <li><a rel="nofollow" href="{% url begin "yahoo" %}">Yahoo</a></li>
+    <li><a rel="nofollow" href="{% url socialauth_begin "google" %}">Google</a></li>
+    <li><a rel="nofollow" href="{% url socialauth_begin "yahoo" %}">Yahoo</a></li>
     <li>
-      <form action="{% url begin "livejournal" %}" method="post">{% csrf_token %}
+      <form action="{% url socialauth_begin "livejournal" %}" method="post">{% csrf_token %}
         <div>
           <label for="openid_lj_user">LiveJournal user:</label>
           <input id="openid_lj_user" type="text" value="" name="openid_lj_user" />
@@ -37,7 +37,7 @@
       </form>
     </li>
     <li>
-      <form action="{% url begin "openid" %}" method="post">{% csrf_token %}
+      <form action="{% url socialauth_begin "openid" %}" method="post">{% csrf_token %}
         <div>
           <label for="openid_identifier">Other provider</label>
           <input id="openid_identifier" type="text" value="" name="openid_identifier" />
index d804d6f722bbe2004ad73ca9aebda47bf60cdd17..c0c324b8bb3884b01d9eae9d59378faf2208c85b 100644 (file)
@@ -22,7 +22,7 @@ REDIRECT_RE = re.compile('window.location.replace\("(.*)"\);')
 
 class FacebookTestLogin(FacebookTestCase):
     def test_login_succeful(self):
-        response = self.client.get(self.reverse('begin', 'facebook'))
+        response = self.client.get(self.reverse('socialauth_begin', 'facebook'))
         # social_auth must redirect to service page
         self.assertEqual(response.status_code, 302)
 
index 52c99ee67df49d8390946d17921851e9a8152edb..94509fa92673beb921fdfd7acb5371067cab234f 100644 (file)
@@ -23,7 +23,7 @@ class GoogleOpenIdTestLogin(GoogleTestCase):
     SERVER_PORT = '8000'
 
     def test_login_succeful(self):
-        response = self.client.get(self.reverse('begin', 'google'))
+        response = self.client.get(self.reverse('socialauth_begin', 'google'))
 
         parser = FormParserByID('openid_message')
         parser.feed(response.content)
index 19406db5458378b69a901070846d4520e7f18d5b..9a77a6075d9a2e61f568fd3e433056cf20f8202b 100644 (file)
@@ -16,7 +16,7 @@ class TwitterTestCase(SocialAuthTestsCase):
 
 class TwitterTestLogin(TwitterTestCase):
     def test_login_succeful(self):
-        response = self.client.get(self.reverse('begin', 'twitter'))
+        response = self.client.get(self.reverse('socialauth_begin', 'twitter'))
         # social_auth must redirect to service page
         self.assertEqual(response.status_code, 302)
 
index 61dadeab468dfbd9e82f0f3a0d832e5ba6285e30..17c2b76de1d62798226bcb9ca8f00d2e29efcc99 100644 (file)
@@ -6,12 +6,12 @@ from social_auth.views import auth, complete, associate, associate_complete, \
 
 
 urlpatterns = patterns('',
-    url(r'^login/(?P<backend>[^/]+)/$', auth, name='begin'),
-    url(r'^complete/(?P<backend>[^/]+)/$', complete, name='complete'),
-    url(r'^associate/(?P<backend>[^/]+)/$', associate, name='associate_begin'),
+    url(r'^login/(?P<backend>[^/]+)/$', auth, name='socialauth_begin'),
+    url(r'^complete/(?P<backend>[^/]+)/$', complete, name='socialauth_complete'),
+    url(r'^associate/(?P<backend>[^/]+)/$', associate, name='socialauth_associate_begin'),
     url(r'^associate/complete/(?P<backend>[^/]+)/$', associate_complete,
-        name='associate_complete'),
-    url(r'^disconnect/(?P<backend>[^/]+)/$', disconnect, name='disconnect'),
+        name='socialauth_associate_complete'),
+    url(r'^disconnect/(?P<backend>[^/]+)/$', disconnect, name='socialauth_disconnect'),
     url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>\d+)/$', disconnect,
-        name='disconnect_individual'),
+        name='socialauth_disconnect_individual'),
 )
index 6edfee69a74046f1c152d54873f223dbe476a046..f65407871babddc195be833dde7c5c3488266610 100644 (file)
@@ -20,11 +20,11 @@ NEW_USER_REDIRECT = _setting('SOCIAL_AUTH_NEW_USER_REDIRECT_URL')
 NEW_ASSOCIATION_REDIRECT = _setting('SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL')
 DISCONNECT_REDIRECT_URL = _setting('SOCIAL_AUTH_DISCONNECT_REDIRECT_URL')
 LOGIN_ERROR_URL = _setting('LOGIN_ERROR_URL', settings.LOGIN_URL)
-COMPLETE_URL_NAME = _setting('SOCIAL_AUTH_COMPLETE_URL_NAME', 'complete')
+COMPLETE_URL_NAME = _setting('SOCIAL_AUTH_COMPLETE_URL_NAME', 'socialauth_complete')
 ASSOCIATE_URL_NAME = _setting('SOCIAL_AUTH_ASSOCIATE_URL_NAME',
-                              'associate_complete')
+                              'socialauth_associate_complete')
 SOCIAL_AUTH_LAST_LOGIN = _setting('SOCIAL_AUTH_LAST_LOGIN',
-                                 'social_auth_last_login_backend')
+                                  'social_auth_last_login_backend')
 SESSION_EXPIRATION = _setting('SOCIAL_AUTH_SESSION_EXPIRATION', True)