Commits

Udi Bauman committed b7eacd9

small changes to fix the login of new users. not yet solved tho.

Comments (0)

Files changed (7)

Binary file modified.

django_ultrasound/customers/models.py

         verbose_name=_("HTML page")
         verbose_name_plural= _("HTML page")
 
-REQUESTING_TO_BE_CANDIDATE = 1
-CANDIDATE = 2
-CANDIDATE_WITH_DETAILS = 3
-CUSTOMER = 4
-DISTINGUISHED_CUSTOMER = 5
-TEMPORARILY_POSTPONED = 6
-POSTPONED = 7
+REQUESTING_TO_BE_CANDIDATE = 10
+CANDIDATE = 20
+CANDIDATE_WITH_DETAILS = 30
+CUSTOMER = 40
+DISTINGUISHED_CUSTOMER = 50
+TEMPORARILY_POSTPONED = 60
+POSTPONED = 70
 
 CUSTOMER_STATUS_CHOICES = ((REQUESTING_TO_BE_CANDIDATE, _("Requesting to be candidate")),
                            (CANDIDATE, _("Candidate")),

django_ultrasound/djangoappengine/settings_base.py

 
 from djangoappengine.utils import on_production_server, have_appserver
 
-DEBUG = not on_production_server
+#DEBUG = not on_production_server
+DEBUG = True
 TEMPLATE_DEBUG = DEBUG
 
 ROOT_URLCONF = 'urls'

django_ultrasound/localsettings.py

 
 
 ADMINS = (
-    ('Rami', 'rami.zelingher@gmail.com'),
+#    ('Rami', 'rami.zelingher@gmail.com'),
 )

django_ultrasound/socialauth/templates/socialauth/login_page.html

 
 <form action="{% url socialauth_openid_login %}" method="get" id="openid_form">
   <input type="hidden" name="action" value="verify" />
-  
+
   <fieldset>
-	<legend>Sign-in or Create New Account via these openid providers</legend>
-	
-	<div id="openid_choice">
-	  <p>Please click your account provider:</p>
-	
-	  <div id="openid_btns">
+	<legend>Sign-in via Facebook</legend>
+
 	    {% if FACEBOOK_APP_ID %}
 		  <div id="facebook">
 			<p><fb:login-button perms="{{ login_button_perms }}"></fb:login-button></p>
-		  </div>	  
+		  </div>
 		{% endif %}
-		
-		<div id="linkedin">
-		  <a href="{% url socialauth_linkedin_login %}?next={{ next }}" id="linkedin_login_link" class="openid_large_btn linkedin"></a>
-		</div>
-	  
-		<div id="twitter">
-		  <a href="{% url socialauth_twitter_login %}?next={{ next }}" id="twitter_login_link" class="openid_large_btn twitter"></a>
-		</div>
-	  
-		<!--<div id="yahoo">
-		  <a href="{% url socialauth_yahoo_login %}" id="yahoo_login_link" class="openid_large_btn yahoo"></a>
-		</div>-->
-	  </div>
+
 
       <input type="hidden" name="openid_next" value="{{ next }}">
-	
-	  <div id="openid_input_area">
-		<input id="openid_identifier" name="openid_identifier" type="text" value="http://" />
-		<input id="openid_submit" type="submit" value="Sign-In"/>
-	  </div>
-	</div>
-	
-	<noscript>
-	  <p>
-		OpenID is service that allows you to log-on to many different websites using a single indentity. Find out 
-		<a href="http://openid.net/what/">more about OpenID</a> and 
-		<a href="http://openid.net/get/">how to get an OpenID enabled account</a>.
-	  </p>
-	</noscript>
-	
+
   </fieldset>
-  
+
 </form>
 
 
 
-    
-    
+
+
     <br />
     <br />
     <br />
-    
+
 </div>
 {% endif %}
 {% endblock %}

django_ultrasound/socialauth/views.py

 
 @login_required
 def signin_complete(request):
-    return render_to_response('socialauth/signin_complete.html', context_instance=RequestContext(request))
+#    return render_to_response('socialauth/signin_complete.html', context_instance=RequestContext(request))
+    return HttpResponseRedirect(LOGIN_REDIRECT_URL)
 
 @login_required
 def editprofile(request):

django_ultrasound/urls.py

 
     (r'^setup/create_first_user/', 'employees.views.setup_first_user'),
 
-    (r'^accounts/login/', 'django.contrib.auth.views.login'),
+#    (r'^accounts/login/', 'django.contrib.auth.views.login'),
+    (r'^accounts/', include('socialauth.urls')),
 
     (r'^home/', 'customers.views.customer_home'),
     (r'^employee_home/', 'employees.views.employee_home'),
 )
 
 #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'),
-    url(r'^facebook_login/$', 'facebook_login', name='socialauth_facebook_login'),
-    url(r'^facebook_login/done/$', 'facebook_login_done', name='socialauth_facebook_login_done'),
-    url(r'^login/$', 'login_page', name='socialauth_login_page'),
-    url(r'^openid_login/$', 'openid_login_page', name='socialauth_openid_login_page'),
-    url(r'^twitter_login/$', 'twitter_login', name='socialauth_twitter_login'),
-    url(r'^twitter_login/done/$', 'twitter_login_done', name='socialauth_twitter_login_done'),
-    url(r'^linkedin_login/$', 'linkedin_login', name='socialauth_linkedin_login'),
-    url(r'^linkedin_login/done/$', 'linkedin_login_done', name='socialauth_linkedin_login_done'),
-    url(r'^yahoo_login/$', 'yahoo_login', name='socialauth_yahoo_login'),
-    url(r'^yahoo_login/complete/$', complete, name='socialauth_yahoo_complete'),
-    url(r'^gmail_login/$', 'gmail_login', name='socialauth_google_login'),
-    url(r'^gmail_login/complete/$', complete, name='socialauth_google_complete'),
-    url(r'^openid/$', 'openid_login', name='socialauth_openid_login'),
-    url(r'^openid/complete/$', complete, name='socialauth_openid_complete'),
-    url(r'^openid/signout/$', signout, name='openid_signout'),
-    url(r'^openid/done/$', 'openid_done', name='openid_openid_done'),
-)
+#urlpatterns += patterns('socialauth.views',
+#    url(r'^facebook_login/xd_receiver.htm$', direct_to_template, {'template':'socialauth/xd_receiver.htm'}, name='socialauth_xd_receiver'),
+#    url(r'^facebook_login/$', 'facebook_login', name='socialauth_facebook_login'),
+#    url(r'^facebook_login/done/$', 'facebook_login_done', name='socialauth_facebook_login_done'),
+#    url(r'^login/$', 'login_page', name='socialauth_login_page'),
+#    url(r'^openid_login/$', 'openid_login_page', name='socialauth_openid_login_page'),
+#    url(r'^twitter_login/$', 'twitter_login', name='socialauth_twitter_login'),
+#    url(r'^twitter_login/done/$', 'twitter_login_done', name='socialauth_twitter_login_done'),
+#    url(r'^linkedin_login/$', 'linkedin_login', name='socialauth_linkedin_login'),
+#    url(r'^linkedin_login/done/$', 'linkedin_login_done', name='socialauth_linkedin_login_done'),
+#    url(r'^yahoo_login/$', 'yahoo_login', name='socialauth_yahoo_login'),
+#    url(r'^yahoo_login/complete/$', complete, name='socialauth_yahoo_complete'),
+#    url(r'^gmail_login/$', 'gmail_login', name='socialauth_google_login'),
+#    url(r'^gmail_login/complete/$', complete, name='socialauth_google_complete'),
+#    url(r'^openid/$', 'openid_login', name='socialauth_openid_login'),
+#    url(r'^openid/complete/$', complete, name='socialauth_openid_complete'),
+#    url(r'^openid/signout/$', signout, name='openid_signout'),
+#    url(r'^openid/done/$', 'openid_done', name='openid_openid_done'),
+#)
 
 urlpatterns += patterns('socialauth.views',
 #    url(r'^$', 'login_page', name='socialauth_index'),
 
 urlpatterns += patterns('',
     (r'^', include('employees.urls')),
-    (r'^$', 'socialauth.views.facebook_login'),
+    (r'^$', 'socialauth.views.signin_complete'),
 )