Add missing keyword argument to format() calls in validation error
messages. This ensures the invalid data value is properly included in
the error message returned to the user.
Fixes#22719
Pass the device context to resolve_name() when creating port mappings
and assigning interface bridges. This ensures that component template
names containing {vc_position} resolve consistently with the names of
the instantiated device components.
Fixes#22707
Replicate Bootstrap's invalid styling for Tom Select widgets with
explicit .is-invalid class, and apply NetBox's server-side error border
to widgets with aria-invalid='true'. This ensures consistent validation
feedback across both client and server-side validation states.
Fixes#22712
CachedScopeMixin._region and ._site_group may cache ancestors of a
Site or Location scope. Change these relationships to SET_NULL so
deleting a Region or SiteGroup clears the cached value instead of
deleting the scoped Prefix, Cluster, or WirelessLAN.
Add reverse GenericRelation fields for Cluster and WirelessLAN on
Region and SiteGroup. This preserves the expected cascade when a
Region or SiteGroup is itself the direct scope, matching the existing
Prefix behavior.
Add migrations recording the ORM-level on_delete changes and regression
coverage for Site, Location, and direct Region/SiteGroup scopes.
Rename the 'results' key to 'errors' and omit successful objects from
the bulk create/update/destroy error response, applied consistently
across all three mixins. len(errors) replaces the separate error_count
bookkeeping. Also change the ProtectedError/RestrictedError entry's
'detail' key to '__all__' to match the field-based error format used
by creates and updates, and correct a comment that implied bulk delete
enforces a permission boundary the single-object delete endpoint
doesn't actually have.
Addresses review feedback from @jeremystretch.
Add initial Python package support for NetBox, including wheel and sdist
builds, generated package metadata, and Test PyPI publishing for maintainer
validation.
Add package-aware CLI support, `netbox setup` scaffolding for instance-local
files, and centralized wheel-vs-checkout path handling while preserving the
existing source/archive install layout.
Bundle pre-rendered embedded documentation in the wheel, and extend CI to
verify dependency pins, wheel metadata, artifact contents, CLI behavior, sdist
rebuilds, and smoke-test upgrades.
Force autoescape=False in ConfigTemplate.get_environment_params() after
merging user-supplied environment parameters. Config templates produce
plain-text network configurations and scripts, so HTML autoescaping is
not applicable.
Keep the override out of the shared render_jinja2() helper so export
templates can continue to use autoescape=True for HTML output. Add
regression coverage for both behaviors.
Expose an event's prechange and postchange snapshots to event rule
condition evaluation, making snapshots.prechange.<attr> and
snapshots.postchange.<attr> available through the existing dot-path
syntax.
Add changed and unchanged snapshot operators for comparing an attribute
across the two snapshots without requiring a condition value. These
operators support rules such as firing only when a field transitions to a
specific state.
Make condition values optional only for snapshot operators by introducing
a missing-value sentinel, while preserving value requirements for all
other operators. Reject invalid combinations such as using changed or
unchanged with an explicit value or with an attr starting with snapshots.
Fail closed when condition paths traverse invalid snapshot structures,
including raw scalar snapshot values such as status strings, by treating
unresolvable snapshot-operator paths as missing and converting invalid
direct paths to InvalidCondition.
Document the new snapshot path syntax, changed and unchanged operators,
create/delete snapshot behavior, and the serialization differences
between snapshot data and REST API data. Add regression and integration
tests covering validation, transition behavior, null snapshot edge cases,
direct snapshot paths, and event rule evaluation.
Enable comma-separated Device, Power Panel, and Termination name lists
in Cable CSV/JSON/YAML imports. Each side accepts either one parent for
all terminations or one parent per name, preserving submission order for
connector assignment.
Add validation for duplicate terminations, empty names, parent count
mismatches, and MultipleObjectsReturned cases. Change side_a/b_device
and side_a/b_power_panel fields from CSVModelChoiceField to
CSVModelMultipleChoiceField with updated help text.
Fixes#18645
Add PUT/PATCH support to ScriptModuleViewSet for replacing Script Module
content in place. Modules can be addressed by numeric ID or file name,
and the uploaded file name must match the existing file path.
The module's scripts are re-synchronized from the new content after
successful update.
Fixes#22544
Success is now inferred from the absence of an errors key, matching
Jeremy's suggestion. Error entries carry only {id/index, errors};
successful entries carry only {id/index}. Update all tests accordingly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move single-object create back inside transaction.atomic() (comment 1)
- Replace repeated result-list iterations with local error_count counters
in create(), perform_bulk_update(), and perform_bulk_destroy() (comments 3, 4, 6)
- Rewrite perform_bulk_update() from two-pass (validate-all, save-all) to
sequential per-object validate+save, matching SequentialBulkCreatesMixin;
subsequent validators now see DB state from prior saves so cross-object
uniqueness conflicts are caught at validation time (comment 5)
- Update bulk_update() and bulk_destroy() callers to unpack new return tuples
and use the counters directly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>