Fixes #21124: Fix rear port selection when creating front ports on a module type #587

Closed
opened 2026-04-05 16:48:05 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jeremystretch on 1/14/2026

Fixes: #21124

  • Move port_mapping_model from FrontPortFormMixin to two model forms, and also define rear_port_model
  • Remove the apparently unused parent_field attribute
  • Collapse the individual implementations of _get_rear_port_choices() from FrontPortForm and FrontPortTemplateForm into FrontPortFormMixin
  • Refactor _get_rear_port_choices() to accept a Q filter rather than a parent object
  • Tweak FrontPortTemplateForm to glean either a device type or a module type (this is the actual bug fix)
*Originally created by @jeremystretch on 1/14/2026* ### Fixes: #21124 - Move `port_mapping_model` from FrontPortFormMixin to two model forms, and also define `rear_port_model` - Remove the apparently unused `parent_field` attribute - Collapse the individual implementations of `_get_rear_port_choices()` from FrontPortForm and FrontPortTemplateForm into FrontPortFormMixin - Refactor `_get_rear_port_choices()` to accept a Q filter rather than a parent object - Tweak FrontPortTemplateForm to glean either a device type or a module type (this is the actual bug fix)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#587