Fixes #20554: Add ContentTypeFilter to several filtersets #1056

Closed
opened 2026-04-05 20:06:57 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pheus on 10/15/2025

Fixes: #20554

Summary
Switch ipam.Service filtering to use ContentTypeFilter for parent_object_type and apply the same approach anywhere we expose a generic relation via filters (e.g., object_type, related_object_type, assigned_object_type). This lets GET filters accept the documented <app>.<model> form (e.g., virtualization.virtualmachine) and aligns GET with POST and existing usability across the app.

What changed

  • Replaced integer-based validation with ContentTypeFilter for parent_object_type in the Services filterset.
  • Standardized on ContentTypeFilter for similar parameters across filtersets where applicable.
  • Added/updated tests to cover filtering via <app>.<model> for the affected params.

Why
Fixes the “Value must be an integer” error when filtering Services by parent_object_type and brings behavior in line with how generic relations are documented and used elsewhere. No database or schema changes.

*Originally created by @pheus on 10/15/2025* ### Fixes: #20554 **Summary** Switch `ipam.Service` filtering to use `ContentTypeFilter` for `parent_object_type` and apply the same approach anywhere we expose a generic relation via filters (e.g., `object_type`, `related_object_type`, `assigned_object_type`). This lets GET filters accept the documented `<app>.<model>` form (e.g., `virtualization.virtualmachine`) and aligns GET with POST and existing usability across the app. **What changed** - Replaced integer-based validation with `ContentTypeFilter` for `parent_object_type` in the Services filterset. - Standardized on `ContentTypeFilter` for similar parameters across filtersets where applicable. - Added/updated tests to cover filtering via `<app>.<model>` for the affected params. **Why** Fixes the “Value must be an integer” error when filtering Services by `parent_object_type` and brings behavior in line with how generic relations are documented and used elsewhere. No database or schema changes.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#1056