diff --git a/combo/manager/views.py b/combo/manager/views.py index a789008e..bde64776 100644 --- a/combo/manager/views.py +++ b/combo/manager/views.py @@ -803,7 +803,7 @@ class PageDuplicateCellView(ManagedPageMixin, FormView): def dispatch(self, request, *args, **kwargs): try: self.current_cell = CellBase.get_cell(kwargs['cell_reference'], page=kwargs['page_pk']) - except LinkListCell.DoesNotExist: + except ObjectDoesNotExist: raise Http404 return super().dispatch(request, *args, **kwargs) diff --git a/tests/test_manager.py b/tests/test_manager.py index 2272ef8a..c50441b6 100644 --- a/tests/test_manager.py +++ b/tests/test_manager.py @@ -1490,6 +1490,9 @@ def test_duplicate_cell(app, admin_user): assert PageSnapshot.objects.filter(page=page).count() == 1 assert PageSnapshot.objects.filter(page=other_page).count() == 2 + app.get('/manage/pages/%s/cell/data_textcell-%s/duplicate' % (0, cell.pk), status=404) + app.get('/manage/pages/%s/cell/data_textcell-%s/duplicate' % (page.pk, 0), status=404) + def test_edit_cell_visibility(settings, app, admin_user): settings.CELL_CONDITIONS_ENABLED = False