From 478dcb7217d6048b80803caaf3ce58029c2bba78 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 15 Nov 2025 22:47:37 +0000 Subject: [PATCH] Add success URL redirection for CaseCollectionCreate after successful creation --- atlas/migrations/0084_resource_open_access.py | 18 ++++++++++++++++++ atlas/views.py | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 atlas/migrations/0084_resource_open_access.py diff --git a/atlas/migrations/0084_resource_open_access.py b/atlas/migrations/0084_resource_open_access.py new file mode 100644 index 00000000..afc7761a --- /dev/null +++ b/atlas/migrations/0084_resource_open_access.py @@ -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.'), + ), + ] diff --git a/atlas/views.py b/atlas/views.py index cc9abc90..bd1bee0d 100755 --- a/atlas/views.py +++ b/atlas/views.py @@ -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