diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7c26a33e66..7b81d7e102 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -40,6 +40,7 @@ Changelog * Fix: Saving a page by pressing enter key no longer triggers a "Changes may not be saved message" (Sean Muck, Matt Westcott) * Fix: RoutablePageMixin no longer breaks in the presence of instance-only attributes such as those generated by FileFields (Fábio Macêdo Mendes) * Fix: The `--schema-only` flag on update_index no longer expects an argument (Karl Hobley) + * Fix: Added file handling to support custom user add/edit forms with images/files (Eraldo Energy) 1.5.3 (18.07.2016) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 0682d4062d..46a67ed49f 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -159,6 +159,7 @@ Contributors * sebworks * Sean Muck * Fábio Macêdo Mendes +* Eraldo Energy Translators =========== diff --git a/docs/releases/1.6.rst b/docs/releases/1.6.rst index 5d3db944ea..6a7846f1c9 100644 --- a/docs/releases/1.6.rst +++ b/docs/releases/1.6.rst @@ -70,6 +70,7 @@ Bug fixes * Saving a page by pressing enter key no longer triggers a "Changes may not be saved message" (Sean Muck, Matt Westcott) * RoutablePageMixin no longer breaks in the presence of instance-only attributes such as those generated by FileFields (Fábio Macêdo Mendes) * The ``--schema-only`` flag on update_index no longer expects an argument (Karl Hobley) + * Added file handling to support custom user add/edit forms with images/files (Eraldo Energy) Upgrade considerations diff --git a/wagtail/tests/customuser/migrations/0002_added_file_field.py b/wagtail/tests/customuser/migrations/0002_added_file_field.py new file mode 100644 index 0000000000..1a6a27faae --- /dev/null +++ b/wagtail/tests/customuser/migrations/0002_added_file_field.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('customuser', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='CustomUser', + name='attachment', + field=models.FileField(blank=True), + ), + ] diff --git a/wagtail/tests/customuser/models.py b/wagtail/tests/customuser/models.py index fc2ef95779..93c79edcfc 100644 --- a/wagtail/tests/customuser/models.py +++ b/wagtail/tests/customuser/models.py @@ -41,6 +41,7 @@ class CustomUser(AbstractBaseUser, PermissionsMixin): first_name = models.CharField(max_length=50, blank=True) last_name = models.CharField(max_length=50, blank=True) country = models.CharField(max_length=100, blank=True) + attachment = models.FileField(blank=True) USERNAME_FIELD = 'username' REQUIRED_FIELDS = ['email'] diff --git a/wagtail/tests/settings.py b/wagtail/tests/settings.py index 2defe9cc15..5a3a51436f 100644 --- a/wagtail/tests/settings.py +++ b/wagtail/tests/settings.py @@ -168,7 +168,7 @@ WAGTAIL_SITE_NAME = "Test Site" # needs to here because it is used at the module level of wagtailusers.forms # when the module gets loaded. The decorator 'override_settings' does not work # in this scenario. -WAGTAIL_USER_CUSTOM_FIELDS = ['country'] +WAGTAIL_USER_CUSTOM_FIELDS = ['country', 'attachment'] WAGTAILADMIN_RICH_TEXT_EDITORS = { 'default': { diff --git a/wagtail/wagtailusers/templates/wagtailusers/users/create.html b/wagtail/wagtailusers/templates/wagtailusers/users/create.html index 898553f17a..bbd3f0e252 100644 --- a/wagtail/wagtailusers/templates/wagtailusers/users/create.html +++ b/wagtail/wagtailusers/templates/wagtailusers/users/create.html @@ -12,7 +12,7 @@