SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 69e33593 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

add is_active boolean for collections

parent 7c0680d8
No related branches found
No related tags found
No related merge requests found
# 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),
),
]
...@@ -72,6 +72,7 @@ class Collection(models.Model): ...@@ -72,6 +72,7 @@ class Collection(models.Model):
), ),
) )
image = models.ImageField(upload_to="series/collections/images/", blank=True) image = models.ImageField(upload_to="series/collections/images/", blank=True)
is_active = models.BooleanField(default=True)
expected_authors = models.ManyToManyField( expected_authors = models.ManyToManyField(
"profiles.Profile", blank=True, related_name="collections_authoring" "profiles.Profile", blank=True, related_name="collections_authoring"
......
...@@ -1297,6 +1297,7 @@ class SubmissionForm(forms.ModelForm): ...@@ -1297,6 +1297,7 @@ class SubmissionForm(forms.ModelForm):
choices=[(None, "None")] choices=[(None, "None")]
+ list( + list(
Collection.objects.all() Collection.objects.all()
.filter(is_active=True)
.order_by("-event_start_date") .order_by("-event_start_date")
# Short name is `event_suffix` if set, otherwise `event_name` # Short name is `event_suffix` if set, otherwise `event_name`
.annotate(name_with_series=Concat("series__name", Value(" - "), "name")) .annotate(name_with_series=Concat("series__name", Value(" - "), "name"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment