diff --git a/core/forms.py b/core/forms.py index 27f3bba..357b27b 100644 --- a/core/forms.py +++ b/core/forms.py @@ -63,6 +63,7 @@ class AggregatorForm(RestrictedFormMixin, ModelForm): "secret_id", "secret_key", "poll_interval", + "enabled", ) help_texts = { "name": "The name of the aggregator connection.", @@ -70,4 +71,5 @@ class AggregatorForm(RestrictedFormMixin, ModelForm): "secret_id": "The secret ID for the aggregator service.", "secret_key": "The secret key for the aggregator service.", "poll_interval": "The interval in seconds to poll the aggregator service.", + "enabled": "Whether or not the aggregator connection is enabled.", } diff --git a/core/migrations/0003_aggregator_enabled.py b/core/migrations/0003_aggregator_enabled.py new file mode 100644 index 0000000..29675ed --- /dev/null +++ b/core/migrations/0003_aggregator_enabled.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.7 on 2023-03-07 17:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0002_alter_notificationsettings_user_aggregator'), + ] + + operations = [ + migrations.AddField( + model_name='aggregator', + name='enabled', + field=models.BooleanField(default=True), + ), + ] diff --git a/core/models.py b/core/models.py index c8549f4..29e587e 100644 --- a/core/models.py +++ b/core/models.py @@ -43,3 +43,5 @@ class Aggregator(models.Model): secret_key = models.CharField(max_length=1024, null=True, blank=True) access_token = models.CharField(max_length=1024, null=True, blank=True) poll_interval = models.IntegerField(default=10) + + enabled = models.BooleanField(default=True) diff --git a/core/templates/partials/aggregator-list.html b/core/templates/partials/aggregator-list.html index f789e94..162f9d7 100644 --- a/core/templates/partials/aggregator-list.html +++ b/core/templates/partials/aggregator-list.html @@ -15,6 +15,7 @@