Closes #22048: Deprecate expand_ipaddress_pattern() (#22051)

This commit is contained in:
Jeremy Stretch
2026-04-30 10:50:12 -04:00
committed by GitHub
parent 1452d57f38
commit 92c5aff713

View File

@@ -1,4 +1,5 @@
import re
import warnings
from django import forms
from django.forms.models import fields_for_model
@@ -294,3 +295,15 @@ def validate_csv(headers, fields, required_fields):
for f in required_fields:
if f not in headers:
raise forms.ValidationError(_('Required column header "{header}" not found.').format(header=f))
# TODO: Remove in NetBox v4.7.0
def __getattr__(name):
if name == 'expand_ipaddress_pattern':
warnings.warn(
"expand_ipaddress_pattern() has been renamed to expand_ipnetwork_pattern(). "
"expand_ipaddress_pattern() will be removed in NetBox v4.7.0.",
DeprecationWarning,
)
return expand_ipnetwork_pattern
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")