The current block id generation only sets the id as the block is serialized for storage in the database, which means that the id is unavailable in the block until it is pulled back from the database. In my debugging this caused the id to be set to new values up to 3 times when saving a brand new page (each time with a new id).
This updated logic applies the new id to the actual block which makes it available right away and prevents the id from being regenerated.
This commit adds WAGTAIL_EMAIL_MANAGEMENT_ENABLED setting that defaults
to True, but when disabled, hides the 'Change email' button in account
management view, and disables the associated route. This is useful when
using external authentication method like LDAP or OpenID Connect where
email management is handled elsewhere.
Wagtail already includes WAGTAIL_PASSWORD_MANAGEMENT_ENABLED setting.
This is almost exact copy of that implementation.
Fix doc and test on ES6 python client compat
This commit changes the statement that version < 6.3.1 of the
elasticsearch python client should be used to instead state
that 6.4.0 is fine.
It also update the tests to reflect the statement.
Initially the `update_all_types` argument has been used to work
around an issue described in:
https://github.com/wagtail/wagtail/issues/2968
This argument was removed in elasticsearch-py 6.3.1 and making
use of it was raising an error.
With 6.4.0 nothing is raising anymore.
Resolves "DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working" - see #5484
The USERNAME_FIELD exists to allow customisation. Therefore we should make an assumption that `.username` exists on the model. Instead, we need to pull the required value from the USERNAME_FIELD and add in a fallback default.
revisions_for_moderation() was iterating over Page instances only
to use their path attribute. The optimization uses values_list()
over the GroupPagePermission queryset to retrieve only the page
paths without having to create the model instances in memory. This
saves roughly 50% of the runtime.
The string of self.form is the same as form.as_table - which is too verbose.
This updates the __repr__ of EditHandler/FieldPanel to show the class name of the form being used instead (or NoneType if it's None).
This generated block of code needs to stay or else there will be an error while running ./manage.py migrate. It is misleading that it is not included in this tutorial.