From 59dce87ba0322b3db59f5c6b1433fe24e66fbf8b Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 13 May 2025 11:21:06 -0400 Subject: [PATCH] Fixes #19465: Fix ability to clear assigned prefix scope in UI (#19479) --- netbox/dcim/forms/mixins.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netbox/dcim/forms/mixins.py b/netbox/dcim/forms/mixins.py index 98862af10..5a57e3364 100644 --- a/netbox/dcim/forms/mixins.py +++ b/netbox/dcim/forms/mixins.py @@ -66,6 +66,10 @@ class ScopedForm(forms.Form): if self.instance and scope_type_id != self.instance.scope_type_id: self.initial['scope'] = None + else: + # Clear the initial scope value if scope_type is not set + self.initial['scope'] = None + class ScopedBulkEditForm(forms.Form): scope_type = ContentTypeChoiceField(