Merge branch 'kaedroho-quick-fix-1665'

This commit is contained in:
Matt Westcott 2015-09-04 14:50:19 +01:00
commit c5f72e1ce7
4 changed files with 10 additions and 1 deletions

View file

@ -46,6 +46,7 @@ Changelog
* Fix: Form builder pages now pick up template variables defined in the `get_context` method (Christoph Lipp)
* Fix: When copying a page, IDs of child objects within page revision records were not remapped to the new objects; this would cause those objects to be lost from the original page when editing the new one
* Fix: Newly added redirects now take effect on all sites, rather than just the site that the Wagtail admin backend was accessed through
* Fix: Add user form no longer throws a hard error on validation failure
1.0 (16.07.2015)

View file

@ -87,6 +87,7 @@ Bug fixes
* Form builder pages now pick up template variables defined in the ``get_context`` method
* When copying a page, IDs of child objects within page revision records were not remapped to the new objects; this would cause those objects to be lost from the original page when editing the new one
* Newly added redirects now take effect on all sites, rather than just the site that the Wagtail admin backend was accessed through
* Add user form no longer throws a hard error on validation failure
Upgrade considerations

View file

@ -43,8 +43,13 @@ class UsernameForm(forms.ModelForm):
class UserCreationForm(UsernameForm):
required_css_class = "required"
error_messages = {
'duplicate_username': _("A user with that username already exists."),
'password_mismatch': _("The two password fields didn't match."),
}
is_superuser = forms.BooleanField(
label=_("Administrator"),
required=False,

View file

@ -96,6 +96,8 @@ class TestUserCreateView(TestCase, WagtailTestUtils):
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'wagtailusers/users/create.html')
self.assertTrue(response.context['form'].errors['password2'])
# Check that the user was not created
users = get_user_model().objects.filter(username='testuser')
self.assertEqual(users.count(), 0)