Commit 11fe1a1c authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Fix third party signup form

- Do not user `provider` context variable when iterating through auth
  provider objects since it's already passed in context from the signup
  view
parent 6a917617
......@@ -258,5 +258,8 @@ def get_provider(id, user_obj=None, default=None):
"""
Return a provider instance from the auth providers registry.
"""
if not id in PROVIDERS:
raise Exception('Invalid auth provider requested "%s"' % id)
return PROVIDERS.get(id, default)(user_obj)
......@@ -259,6 +259,9 @@ class ThirdPartyUserCreationForm(forms.ModelForm, StoreUserMixin):
super(ThirdPartyUserCreationForm, self).__init__(*args, **kwargs)
if not get_latest_terms():
del self.fields['has_signed_terms']
if 'has_signed_terms' in self.fields:
# Overriding field label since we need to apply a link
# to the terms within the label
......@@ -999,7 +1002,7 @@ class ExtendedProfileForm(ProfileForm):
def _init_extra_form_fields(self):
if self.email_change:
self.fields.update(self.email_change_form.fields)
......
......@@ -4,7 +4,7 @@
<input type="hidden" name="next" value="{{ next }}">
<input type="hidden" name="code" value="{{ code }}">
<input type="hidden" name="provider" value={{ provider.module|default:"local" }}>
<input type="hidden" name="provider" value={{ provider|default:"local" }}>
{% if third_party_token %}
<input type="hidden" name="third_party_token" value={{ third_party_token }}>
{% endif %}
......
......@@ -23,19 +23,19 @@
<p>{% trans "Choose one of the following sign up methods." %}</p>
<div class="extralogin">
{% for provider in auth_providers %}
{% if provider.is_available_for_create %}
{% if provider.module == 'local' %}
<a href="#" class="submit standalone" id="signup-classic">CLASSIC</a>
{% for provider_obj in auth_providers %}
{% if provider_obj.is_available_for_create %}
{% if provider_obj.module == 'local' %}
<a href="#" class="submit standalone" id="signup-classic">CLASSIC SIGN UP</a>
{% if "local" in im_modules %}
{% include "im/auth/signup_form.html" %}
{% endif %}
{% else %}
{% if provider.module == 'shibboleth' %}
<a href="{% provider_login_url provider %}" class="submit standalone">ACADEMIC</a>
{% if provider_obj.module == 'shibboleth' %}
<a href="{% provider_login_url provider_obj %}" class="submit standalone">ACADEMIC SIGN UP</a>
{% else %}
<a href="{% provider_login_url provider %}" title="{{ provider.get_title_display }}" class="icons">
<img src=" {{ provider.get_icon_url_display }}" alt="{{ provider.get_title_display }}">
<a href="{% provider_login_url provider_obj %}" title="{{ provider_obj.get_title_display }}" class="icons">
<img src=" {{ provider_obj.get_icon_url_display }}" alt="{{ provider_obj.get_title_display }}">
</a>
{% endif %}
{% endif %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment