CHOICE_SETS values (IATA, ISO_3166, UN_LOCODE) are lists of (value, label)
tuples, not dicts. The .values() call introduced by #21984 treated them as
dicts, raising AttributeError: 'list' object has no attribute 'values' when
full_clean() was invoked during choice set creation.
Replace with a generator expression that extracts the first element from
each tuple, matching the same pattern used elsewhere in the same model.
Also covers the save() path when order_alphabetically=True but
extra_choices is None (base-only choice set), preventing a TypeError
when sorted() receives None.
Replace manual `clear_config()` and `cache.clear()` calls at test end
with `addCleanup()` registered in `setUp()`. Ensures cleanup runs even
if assertions fail mid-test, preventing Redis pollution across tests.
Fixes#22290
Change action_object_type field in EventRuleFilter from StrFilterLookup
to ContentTypeFilter for proper content type filtering in GraphQL API.
Fixes#22287
Add tearDown method to empty the default queue after each test. Prevents
leftover jobs from leaking into later test suites that may reuse
the same queue instance.
Fixes#22319
Address review feedback on #22253:
- Registry stores resolvers as {app_label: resolver} dict instead of a
flat list, so each app can only register a resolver for its own models.
- register_serializer_resolver() now takes (app_label, resolver) and
get_serializer_for_model() only consults the resolver registered for
the model's own app.
- Remove 'serializer_resolver' from DEFAULT_RESOURCE_PATHS so this niche
resource is loaded only when a plugin explicitly defines it. The
PluginConfig.ready() path imports the configured path directly and
registers it under self.label.
- Update tests for the new per-app scoping; verify a resolver registered
for one app does not affect lookups in another.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add support for literal `{lat}` and `{lon}` placeholders in `MAPS_URL`
when rendering GPS coordinate links. Existing configurations continue to
work by falling back to appending `lat,lon` when no coordinate placeholders
are present.
Move map URL handling into shared UI helpers so `GPSCoordinatesAttr` and
`AddressAttr` use consistent placeholder detection. When `MAPS_URL` contains
coordinate placeholders, suppress address-based map links to avoid rendering
invalid URLs.
Add tests for placeholder replacement, decimal coordinate values, fallback
behavior, and address link suppression. Also document the address link behavior
in the `MAPS_URL` configuration description.
The new "select at least one field" guard fires when rename_fields is set
and no field_names are submitted. Add field_names=['name'] to both the
preview and apply POST data so the test exercises the intended rename path.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The `submitted` list comprehension previously called `f in self.rename_fields`
which raises TypeError when a subclass sets rename_fields=None. Short-circuit
with `self.rename_fields and` to safely handle None, empty tuple, and populated
tuples uniformly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add form error when all field checkboxes are unchecked on submit;
previously fell back to renaming every declared field silently
- Remove obj.new_name backward-compat assignment; no template or
documented plugin API references it (all use obj.new_names now)
- Update base test data to include field_names=['name'] so the guard
does not fire in views-framework tests that don't specify fields
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move field checkboxes before the find/replace/use_regex inputs so they
are not visually conflated with the 'use regex' checkbox
- Fix indentation inside the {% if rename_fields %} block
- Add trailing newline to bulk_rename.html
- Add test_bulk_rename_name_and_label_fields to verify that submitting
field_names=['name', 'label'] updates both fields simultaneously
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>