diff --git a/scipost_django/series/migrations/0010_collection_is_active.py b/scipost_django/series/migrations/0010_collection_is_active.py new file mode 100644 index 0000000000000000000000000000000000000000..07c0cb4a19dc4ffbc4c2aa75959bd1e34efb8b6f --- /dev/null +++ b/scipost_django/series/migrations/0010_collection_is_active.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.15 on 2024-10-07 13:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("series", "0009_collection_event_details"), + ] + + operations = [ + migrations.AddField( + model_name="collection", + name="is_active", + field=models.BooleanField(default=True), + ), + ] diff --git a/scipost_django/series/models.py b/scipost_django/series/models.py index dd0c2e20a0687df13f8ebcdfe21f8a567502b8e4..e22d3706721a5ab662213997a53835c41b19ccc0 100644 --- a/scipost_django/series/models.py +++ b/scipost_django/series/models.py @@ -72,6 +72,7 @@ class Collection(models.Model): ), ) image = models.ImageField(upload_to="series/collections/images/", blank=True) + is_active = models.BooleanField(default=True) expected_authors = models.ManyToManyField( "profiles.Profile", blank=True, related_name="collections_authoring" diff --git a/scipost_django/submissions/forms/__init__.py b/scipost_django/submissions/forms/__init__.py index fd3831e7af5c0e8c9f77ae465f55e9d0ef884317..8bc682eb921f03a3c48fa1828178c9b48ec2d36d 100644 --- a/scipost_django/submissions/forms/__init__.py +++ b/scipost_django/submissions/forms/__init__.py @@ -1297,6 +1297,7 @@ class SubmissionForm(forms.ModelForm): choices=[(None, "None")] + list( Collection.objects.all() + .filter(is_active=True) .order_by("-event_start_date") # Short name is `event_suffix` if set, otherwise `event_name` .annotate(name_with_series=Concat("series__name", Value(" - "), "name"))