From 5eff411db976021c8d4e0aff08eb44352dd61a88 Mon Sep 17 00:00:00 2001 From: MrBlake Date: Tue, 13 Oct 2026 14:13:30 +0200 Subject: [PATCH] Add missing migration for platform constraint message Align the migration state with the model's check constraint, including its violation_error_message. Verified with NetBox 4.7.2. Bump version to 1.13.1. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 1 + netbox_slm/__init__.py | 2 +- .../0015_platform_constraint_message.py | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 netbox_slm/migrations/0015_platform_constraint_message.py diff --git a/CHANGELOG.md b/CHANGELOG.md index ae02240..c40aad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixed +* Add the missing migration for the platform constraint's error message (verified against NetBox 4.7.2) * Make the required single platform destination explicit when creating an installation * Fix installation form submission on NetBox v4.6.5 when form mixins return no cleaned-data value * Prevent the notification log creation flag from shadowing Django's translation function during email delivery diff --git a/netbox_slm/__init__.py b/netbox_slm/__init__.py index 2033879..2887a3f 100644 --- a/netbox_slm/__init__.py +++ b/netbox_slm/__init__.py @@ -17,7 +17,7 @@ limitations under the License. from netbox.plugins import PluginConfig from django.utils.translation import gettext, gettext_lazy as _ -__version__ = "1.13.0" +__version__ = "1.13.1" class SLMConfig(PluginConfig): diff --git a/netbox_slm/migrations/0015_platform_constraint_message.py b/netbox_slm/migrations/0015_platform_constraint_message.py new file mode 100644 index 0000000..c6b1773 --- /dev/null +++ b/netbox_slm/migrations/0015_platform_constraint_message.py @@ -0,0 +1,18 @@ +# Generated by Django 6.1.1 on 2026-10-13 12:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('netbox_slm', '0014_softwarelicense_email_notification_permission'), + ] + + operations = [ + migrations.AlterConstraint( + model_name='softwareproductinstallation', + name='netbox_slm_softwareproductinstallation_platform', + constraint=models.CheckConstraint(condition=models.Q(models.Q(('cluster__isnull', True), ('device__isnull', False), ('virtualmachine__isnull', True)), models.Q(('cluster__isnull', True), ('device__isnull', True), ('virtualmachine__isnull', False)), models.Q(('cluster__isnull', False), ('device__isnull', True), ('virtualmachine__isnull', True)), _connector='OR'), name='netbox_slm_softwareproductinstallation_platform', violation_error_message='Select exactly one platform destination: device, virtual machine, or cluster.'), + ), + ]