Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Commit e6445d4

Browse files
committed
Prefix field errors properly (bug 710353)
1 parent 6a686e8 commit e6445d4

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

media/js/zamboni/browserid_support.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function loadProfileCompletionForm($root, options) {
161161
// {username: ['already exists']...}
162162
$.each(data, function(field, errors) {
163163
$.each(errors, function(i, m) {
164-
msg.push(field + ': ' + m);
164+
msg.push($form.find('label[for="id_' + field + '"]').text() + ': ' + m);
165165
});
166166
});
167167
} else {

media/js/zamboni/tests/profile_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ asyncTest('form error', function() {
7575
loadProfileCompletionForm(sb, {'window': mockWindow});
7676
$form.one('badresponse.profile_completion', function() {
7777
equals($('.notification-box', sb).text(),
78-
'username: invalid characters');
78+
'User name: invalid characters');
7979
$.mockjaxClear(resultMock);
8080
start();
8181
});

templates/qunit/qunit.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,10 @@ <h3>Select a license for your Persona.</h3>
182182
<p class="notification-box error"></p>
183183
<form method="post" action="/complete-profile"
184184
data-post-login-url="/elsewhere">
185-
<input type="text" name="username">
186-
<input type="text" name="display_name">
185+
<label for="id_username">User name</label>
186+
<input type="text" name="username" id="id_username">
187+
<label for="id_display_name">Display Name</label>
188+
<input type="text" name="display_name" id="id_display_name">
187189
<button type="submit">Complete Profile</button>
188190
</form>
189191
</div>

0 commit comments

Comments
 (0)