Add success URL redirection for CaseCollectionCreate after successful creation

This commit is contained in:
Ross
2025-11-15 22:47:37 +00:00
parent a1aba7836a
commit 478dcb7217
2 changed files with 22 additions and 0 deletions
@@ -0,0 +1,18 @@
# Generated by Django 5.2.7 on 2025-11-15 22:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('atlas', '0083_resource_created_date_resource_modified_date'),
]
operations = [
migrations.AddField(
model_name='resource',
name='open_access',
field=models.BooleanField(default=True, help_text='If true the resource is available to all users, otherwise only in the context of cases.'),
),
]
+4
View File
@@ -1385,6 +1385,10 @@ class CaseCollectionCreate(RevisionMixin, LoginRequiredMixin, CreateView):
else:
return super().form_invalid(form)
def get_success_url(self):
"""Redirect to the collection detail page after successful creation."""
return reverse("atlas:collection_detail", kwargs={"pk": self.object.pk})
class SeriesCreate(RevisionMixin, LoginRequiredMixin, CreateView):
model = Series