Switch url parameter to full_name from service-specific gafyd_name

(imported from commit 21541da29d2846cfd912d19b73e239e96606f9e5)
This commit is contained in:
Luke Faraone 2013-11-05 16:13:59 -05:00
parent c11b65590b
commit 00e72cd97d
4 changed files with 6 additions and 7 deletions

View File

@ -29,7 +29,7 @@ def confirm(request, confirmation_key):
'confirmed': confirmed,
'days': getattr(settings, 'EMAIL_CONFIRMATION_DAYS', 10),
'key': confirmation_key,
'gafyd_name': request.GET.get("gafyd_name", None),
'full_name': request.GET.get("full_name", None),
}
templates = [
'confirmation/confirm.html',

View File

@ -12,7 +12,7 @@ post to another view which executes in our code to produce the desired form.
{% csrf_token %}
<input type="hidden" value="{{ key }}" name="key"/>
<input type="hidden" value="1" name="from_confirmation"/>
<input type="hidden" value="{% if gafyd_name %}{{ gafyd_name }}{% endif %}" name="gafyd_name"/>
<input type="hidden" value="{% if full_name %}{{ full_name }}{% endif %}" name="full_name"/>
</form>
<script type="text/javascript">

View File

@ -40,7 +40,7 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
<label for="id_full_name" class="control-label">Full name</label>
<div class="controls">
<input id="id_full_name" class="required" type="text" name="full_name"
value="{% if form.full_name.value %}{{ form.full_name.value }}{% elif gafyd_name %}{{ gafyd_name }}{% endif %}"
value="{% if form.full_name.value %}{{ form.full_name.value }}{% elif full_name %}{{ full_name }}{% endif %}"
maxlength="100" />
{% if form.full_name.errors %}
{% for error in form.full_name.errors %}
@ -55,9 +55,8 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
<input id="id_password" class="required" type="password" name="password"
value="{% if form.password.value %}{{ form.password.value }}{% endif %}"
maxlength="100" />
{% if gafyd_name %}
{% if full_name %}
<span class="help-inline">This is used for mobile applications and other tools that don't support Google Apps authentication.</span>
<input type="hidden" value="{{ gafyd_name }}" name="gafyd_name"/>
{% endif %}
{% if form.password.errors %}
{% for error in form.password.errors %}

View File

@ -334,7 +334,7 @@ def accounts_register(request):
'company_name': domain,
'email': email,
'key': key,
'gafyd_name': request.POST.get('gafyd_name', False),
'full_name': request.POST.get('full_name', False),
},
context_instance=RequestContext(request))
@ -465,7 +465,7 @@ def maybe_send_to_registration(request, email, full_name=''):
"/",
# Split this so we only get the part after the /
Confirmation.objects.get_link_for_object(prereg_user).split("/", 3)[3],
'?gafyd_name=',
'?full_name=',
# urllib does not handle Unicode, so coerece to encoded byte string
# Explanation: http://stackoverflow.com/a/5605354/90777
urllib.quote_plus(full_name.encode('utf8')))))