Add success URL redirection for CaseCollectionCreate after successful creation
This commit is contained in:
@@ -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.'),
|
||||
),
|
||||
]
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user