Wykres commitów

18307 Commity (130a9ebd93946b51775365955af6617851e11c9f)

Autor SHA1 Wiadomość Data
Aayushman Singh ce0601b77c
Limit autocomplete results view to 10
Prevent performance issues when there are many tags available.
2024-11-13 16:12:57 +00:00
Matt Westcott 5212061485
Normalize StreamField.get_default to prevent creation forms from breaking
Fixes #12561

When a ModelForm is constructed without passing an `initial` instance, the result of `StreamField.get_default()` will become the default value of the form field without the intermediate step of being set on a model instance and read back (which would have the side effect of calling `normalize()`). Form rendering only works with normalized values (e.g. StreamValue rather than list-of-tuples for a StreamBlock), so the return value from `get_default()` needs to be normalized.
2024-11-13 15:46:07 +00:00
Sage Abdullah 210f35f7ec
Release note for #12556 2024-11-13 14:20:10 +00:00
Matt Westcott 7a923de427
Set sensible defaults for InlinePanel heading and label 2024-11-13 14:18:49 +00:00
Matt Westcott 253c401ae2
Pass InlinePanel heading rather than label to use as the label for comparisons
Conventionally `label` is singular (used on individual forms as "Speaker 1", "Speaker 2" etc as well as the "Add speaker" button), while `heading` is plural ("Speakers" or "Speaker lineup", used as the main heading for the list). The plural is most appropriate for the comparison view.

Also fix the test for MultipleChooserPanel, which was copied across from the InlinePanel test without actually setting a label/heading on the panel.
2024-11-13 14:18:49 +00:00
Matt Westcott aa31d329ab
Stop invalid Site hostname records from breaking preview
As made famous by https://youtu.be/v3KEaMTfKg0?t=319 :-)

By design, Wagtail tolerates the default Site record being left at its default value of 'localhost' up to a certain point. Ideally, that point should be when it becomes strictly necessary for Wagtail to care about hostnames (such as when setting up the second site of a multi-site installation) and it should be clear to the developer what has happened and how to fix it.

In practice, that point often comes when the developer deploys their site to production, sets `DEBUG=False`, and is then required by Django to set `ALLOWED_HOSTS` to their real domain name. At this point, front-end page requests work (because the initial site record is default=True, matching any domain including the live one) but previews are broken (because the dummy request object is still formed using localhost as per the site's hostname field, which is disallowed by ALLOWED_HOSTS).

This is unnecessary, and can be avoided by validating the hostname against ALLOWED_HOSTS and substituting one that _is_ allowed if necessary, as we already do for pages that don't have an associated site record.
2024-11-13 13:57:14 +00:00
Sage Abdullah 6315d3c1cc
Release note for #12551 2024-11-12 10:59:57 +00:00
Sage Abdullah 92714d87e7
Minor tweaks per code review 2024-11-12 10:58:04 +00:00
Sage Abdullah 533481b0f4
Add note about extending section not subject to deprecation policy 2024-11-08 20:09:39 +00:00
Sage Abdullah 991d9bcab5
Update release process documentation 2024-11-08 20:09:39 +00:00
Sage Abdullah f43cf941d5
Improve upgrade guide to reflect current versioning scheme and highlight important steps 2024-11-08 20:09:39 +00:00
Sage Abdullah 246f3c7eb5 Fix profile picture upload not working in account settings (#12548)
Fixes #12547
2024-11-07 13:03:20 +00:00
Matt Westcott 122b9683fa Add 6.3.1 release notes 2024-11-07 13:03:13 +00:00
Matt Westcott e7e57cd29e Release note for #12488 2024-11-05 22:36:43 +00:00
Jake Howard 98a141cbc3 Assert query counts for page publishing 2024-11-05 22:35:35 +00:00
Jake Howard f68dd505d0 Don't fetch all related instances when creating revision object 2024-11-05 22:35:35 +00:00
Jake Howard aa1a848bf2 Don't fetch entire live revision 2024-11-05 22:35:35 +00:00
Jake Howard 9efdadb68a Only update changed field 2024-11-05 22:35:35 +00:00
Jake Howard 24726b3797 Optimise resetting comment position from revision 2024-11-05 22:35:35 +00:00
Jake Howard 59ac877063 Don't evaluate expired objects 2024-11-05 22:35:35 +00:00
Jake Howard 37567dfe18 Check workflow cancel before getting workflow 2024-11-05 22:35:35 +00:00
ayaan-qadri b0c90d4be2 Removed preventDefault from openPreviewInNewTab in PreviewController
Relates to #10356
2024-11-06 07:47:10 +10:00
LB 825a77d6c2 Remove all eslint-disable no-undef & use global comments (#12527)
Recommendation is to either declare globals in config or in a `/* global ` comment
See https://eslint.org/docs/latest/rules/no-undef#rule-details
2024-11-05 20:11:09 +00:00
LB cae3229716 Remove unnecessary DOM Range polyfill (#12496)
- Remove DOM Range polyfill provided by https://developer.mozilla.org/en-US/docs/Web/API/Range
- All Wagtail supported browsers, as of a few years ago, have built in support for `document.createRange`, see https://developer.mozilla.org/en-US/docs/Web/API/Range
2024-11-05 20:01:31 +00:00
Matt Westcott 3013673c55 Release notes for #12480 2024-11-05 19:48:24 +00:00
LB 281efdbc88 Fix - Ensure `WagtailAdminFormPageForm.clean` works for any related name
Dynamically detect the `related_name` of any form fields attached to the page so that validation is actually run for custom related_names.

This also will apply validation even if there are multiple `AbstractFormField` subclasses related to the page.

Add unit test to ensure that duplicate clean name validation correctly runs on FormPage models with a custom related name.

Originally from #10375
2024-11-05 19:22:33 +00:00
John-Scott Atlakson 9d31fd3fa5 Fix - Ensure `WagtailAdminFormPageForm.clean` returns `cleaned_data`
Return `cleaned_data` for more consistent subclassing.

Updated documentation with an example of adding custom page validation for form fields.

Add unit test to ensure that the documented usage of extending `WagtailAdminFormPageForm` works as expected.

Originally from #10375
2024-11-05 19:22:33 +00:00
minusf f600a356e6
Add missing apostrophe in settings documentation (#12542) 2024-11-05 16:09:55 +00:00
Sage Abdullah f21f6dd884
Release note for #12525 2024-11-05 12:56:59 +00:00
Sage Abdullah 794fa3bcaf
Improve documentation guidelines on writing docstrings and API reference 2024-11-05 12:52:57 +00:00
Sage Abdullah a81cc7345d
Remove e.g. in documentation guidelines 2024-11-05 12:45:26 +00:00
Sage Abdullah 17ce66ad45
Update outdated Pillow links 2024-11-05 10:44:41 +00:00
Sage Abdullah f54b03d595
Use intersphinx to link to treebeard docs 2024-11-05 10:44:41 +00:00
Sage Abdullah da3e0ade37
Use intersphinx to link to MyST-Parser docs 2024-11-05 10:44:41 +00:00
Sage Abdullah ddf8423f3c
Use stable link to Wand docs
There's only one link to Wand's docs, not worth adding an
intersphinx_mapping entry.
2024-11-05 10:44:40 +00:00
Sage Abdullah b7cf847d69
Replace outdated Wagtail editor manual link with link to the editor guide 2024-11-05 10:44:40 +00:00
Sage Abdullah 503d1a743a
Replace hardcoded Python docs links with intersphinx 2024-11-05 10:44:40 +00:00
Sage Abdullah 5615deb5b1
Add Django's custom Sphinx roles and use them to link to settings
This is necessary for rST docs, i.e. in docstrings and in eval-rst
blocks. Without this, Sphinx cannot seem to understand the role. See:
https://stackoverflow.com/questions/13387125

MyST-Parser seems to be smarter, it can figure out these custom
roles without having to register the types ourselves. This is evident in
the previous commits where I already use the :setting: role in markdown
docs.
2024-11-05 10:44:40 +00:00
Sage Abdullah 9a5be8f180
Replace more hardcoded Django links with intersphinx in rST docs
Some link labels are changed to just the code part, because using Sphinx
roles for code objects (e.g. methods, attributes) would always format the
text as inline code.

It's currently impossible to customize the formatting of a link's text in
rST. See https://stackoverflow.com/questions/4743845
2024-11-05 10:44:39 +00:00
Sage Abdullah 857b26e5a0
Replace hardcoded Django docs links to intersphinx links 2024-11-05 10:44:39 +00:00
Sage Abdullah 9d69863f3c
Use intersphinx to link to Sphinx docs 2024-11-05 10:44:39 +00:00
Sage Abdullah 795ca50dc8
Improve clarity between Markdown/MyST, rST, and Sphinx in docs guidelines
Add more emphasis on the divide between when to use Markdown and when to
use rST.

Also improve examples for versionadded and versionchanged directives.
2024-11-05 10:44:39 +00:00
Sage Abdullah 0dc1698857
Do not index autodoc examples 2024-11-05 10:44:39 +00:00
Sage Abdullah 443ccb23a8
Update docs for writing admonitions
It's MyST syntax, not rST, so it's OK to use it (sparingly).

Custom admonitions are possible with the `admonition` directive.
2024-11-05 10:44:38 +00:00
Sage Abdullah 81e6d79c5e
Improve guidelines for writing links in docs 2024-11-05 10:44:38 +00:00
Sage Abdullah dddf9bfd81
Highlight Markdown vs reStructuredText differences for inline styles 2024-11-05 10:24:51 +00:00
Sage Abdullah 121624d5b1
Add syntax highlighting to code block examples 2024-11-05 10:24:51 +00:00
Jake Howard 71c93cb39c Remove non-unsert support for Postgres indexing (#12509)
PostgreSQL 9.4 support was dropped with the release of Django 3.0.
2024-11-04 18:19:29 +00:00
rahulsamant37 5e4c3f12c3 Remove defunct oEmbed providers (#12537)
Fixes #12054
2024-11-04 18:04:33 +00:00
Matt Westcott 0cab6641cc Release note for #12539 2024-11-04 15:40:44 +00:00