mirror of
https://github.com/netbox-community/netbox.git
synced 2026-05-06 14:04:12 +08:00
@@ -1,4 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
|
import warnings
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.forms.models import fields_for_model
|
from django.forms.models import fields_for_model
|
||||||
@@ -294,3 +295,15 @@ def validate_csv(headers, fields, required_fields):
|
|||||||
for f in required_fields:
|
for f in required_fields:
|
||||||
if f not in headers:
|
if f not in headers:
|
||||||
raise forms.ValidationError(_('Required column header "{header}" not found.').format(header=f))
|
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}")
|
||||||
|
|||||||
Reference in New Issue
Block a user