diff mbox series

[layerindex-web,1/2] models.py: add updates_enabled to LayerBranch

Message ID 20231017005439.2616534-2-tim.orling@konsulko.com
State New
Headers show
Series Allow per LayerBranch update disable | expand

Commit Message

Tim Orling Oct. 17, 2023, 12:54 a.m. UTC
Especially since LTS branches have become more popular as the
only active branch, we need to be able to turn off updates on
a LayerBranch basis rather than the current Layer or Branch
heavier hammers.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 .../0047_layerbranch_updates_enabled.py        | 18 ++++++++++++++++++
 layerindex/models.py                           |  2 +-
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 layerindex/migrations/0047_layerbranch_updates_enabled.py
diff mbox series

Patch

diff --git a/layerindex/migrations/0047_layerbranch_updates_enabled.py b/layerindex/migrations/0047_layerbranch_updates_enabled.py
new file mode 100644
index 0000000..44e07ee
--- /dev/null
+++ b/layerindex/migrations/0047_layerbranch_updates_enabled.py
@@ -0,0 +1,18 @@ 
+# Generated by Django 4.2.6 on 2023-10-07 19:39
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('layerindex', '0046_alter_patch_status'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='layerbranch',
+            name='updates_enabled',
+            field=models.BooleanField(default=True, help_text='Enable automatically updating layer metadata for this layer:branch via the update script', verbose_name='Enable updates'),
+        ),
+    ]
diff --git a/layerindex/models.py b/layerindex/models.py
index 5ae60c3..397425a 100644
--- a/layerindex/models.py
+++ b/layerindex/models.py
@@ -241,7 +241,7 @@  class LayerBranch(models.Model):
     actual_branch = models.CharField('Actual Branch', max_length=80, blank=True, help_text='Name of the actual branch in the repository matching the core branch')
     yp_compatible_version = models.ForeignKey(YPCompatibleVersion, verbose_name='Yocto Project Compatible version', null=True, blank=True, on_delete=models.SET_NULL, help_text='Which version of the Yocto Project Compatible program has this layer been approved for for?')
     local_path = models.CharField(max_length=255, blank=True, help_text='Local subdirectory where layer data can be found')
-
+    updates_enabled = models.BooleanField('Enable updates', default=True, help_text='Enable automatically updating layer metadata for this layer:branch via the update script')
     updated = models.DateTimeField(auto_now=True)
 
     class Meta: