manager: fix duplicate cell view with unknown cell id (#63793)
This commit is contained in:
parent
809862bc2d
commit
6e5eef1764
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue