Skip to content

Commit c942f8b

Browse files
committed
Rename to max_custom_object_types
1 parent fddd431 commit c942f8b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configuration Parameters
22

3-
## `max_cots`
3+
## `max_custom_object_types`
44

55
Default: None
66

netbox_custom_objects/models.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,14 @@ def __str__(self):
219219
def clean(self):
220220
super().clean()
221221

222-
# Enforce max number of COTs that may be created (max_cots)
222+
# Enforce max number of COTs that may be created (max_custom_object_types)
223223
if not self.pk:
224-
max_cots = get_plugin_config("netbox_custom_objects", "max_cots")
224+
max_cots = get_plugin_config("netbox_custom_objects", "max_custom_object_types")
225225
if max_cots and CustomObjectType.objects.count() > max_cots:
226-
raise ValidationError(_(f"Maximum number of Custom Object Types ({max_cots}) exceeded"))
226+
raise ValidationError(_(
227+
f"Maximum number of Custom Object Types ({max_cots}) "
228+
"exceeded; adjust max_custom_object_types to raise this limit"
229+
))
227230

228231
@classmethod
229232
def clear_model_cache(cls, custom_object_type_id=None):

0 commit comments

Comments
 (0)