From 58f737c6a355754c0cfde1940500c5fc775a4b8e Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 19 Jul 2023 14:55:41 +0700 Subject: [PATCH] 6347 remove superfluous validate --- netbox/utilities/counter.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/netbox/utilities/counter.py b/netbox/utilities/counter.py index bd63c51eb..ecc8104fe 100644 --- a/netbox/utilities/counter.py +++ b/netbox/utilities/counter.py @@ -49,17 +49,6 @@ class Counter: self.connect() - def validate(self): - counter_field, _, _, _ = self.parent_model._meta.get_field_by_name(self.counter_name) - if not isinstance(counter_field, CounterCacheField): - raise TypeError( - f"{self.counter_name} should be a CounterCacheField on {self.parent_model}, but is {type(counter_field)}" - ) - if not isinstance(self.parent_model, TrackingModelMixin): - raise TypeError( - f"{self.parent_model} should be derived from TrackingModelMixin" - ) - def connect(self): """ Hook up post_save, post_delete signal handlers to the fk field to change the count