From 0423dee329e665d249d7b900ed0c8a977052b58d Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Tue, 9 Sep 2025 20:26:08 +0200 Subject: [PATCH 1/2] fix: disable tags in Setting model Signed-off-by: Michal Fiedorowicz --- netbox_diode_plugin/models.py | 1 + netbox_diode_plugin/tests/test_models.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/netbox_diode_plugin/models.py b/netbox_diode_plugin/models.py index ed9e6c7..bfe8fc9 100644 --- a/netbox_diode_plugin/models.py +++ b/netbox_diode_plugin/models.py @@ -24,6 +24,7 @@ class Setting(NetBoxModel): """Setting model.""" diode_target = models.CharField(max_length=255, validators=[diode_target_validator]) + tags = None class Meta: """Meta class.""" diff --git a/netbox_diode_plugin/tests/test_models.py b/netbox_diode_plugin/tests/test_models.py index fd9571d..39ec423 100644 --- a/netbox_diode_plugin/tests/test_models.py +++ b/netbox_diode_plugin/tests/test_models.py @@ -28,3 +28,8 @@ def test_absolute_url(self): """Check Setting model absolute URL.""" setting = Setting() self.assertEqual(setting.get_absolute_url(), "/netbox/plugins/diode/settings/") + + def test_tags_disabled(self): + """Check Setting model has tags disabled.""" + setting = Setting() + self.assertIsNone(setting.tags) From baab612ee5a1c77bf8eaea8d9ead93a43b525c1f Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Tue, 9 Sep 2025 21:17:00 +0200 Subject: [PATCH 2/2] fix: update test to ensure tags are disabled in Setting model with diode_target Signed-off-by: Michal Fiedorowicz --- netbox_diode_plugin/tests/test_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox_diode_plugin/tests/test_models.py b/netbox_diode_plugin/tests/test_models.py index 39ec423..09424ec 100644 --- a/netbox_diode_plugin/tests/test_models.py +++ b/netbox_diode_plugin/tests/test_models.py @@ -31,5 +31,5 @@ def test_absolute_url(self): def test_tags_disabled(self): """Check Setting model has tags disabled.""" - setting = Setting() + setting = Setting(diode_target="http://localhost:8080") self.assertIsNone(setting.tags)