7

adds working add variation page

This commit is contained in:
Boris Besemer
2016-11-15 15:36:28 +01:00
parent 93eac2cda8
commit 7ec039905d
4 changed files with 90 additions and 9 deletions

View File

@ -73,6 +73,7 @@ class CreateSegmentView(CreateView):
class AddVariation(FormView):
form_class = PersonalisationForm
template_name = "wagtailadmin/add.html"
add_variation_panels = [
FieldPanel('copy_from_canonical'),
@ -84,9 +85,9 @@ class AddVariation(FormView):
base_form_class=PersonalisationForm)
])
def dispatch(self, request, page_pk, segment_name, *args, **kwargs):
def dispatch(self, request, page_pk, segment_pk, *args, **kwargs):
self.page = get_object_or_404(PersonalisablePage, pk=page_pk)
self.segment = get_object_or_404(Segment, name=segment_name)
self.segment = get_object_or_404(Segment, pk=segment_pk)
return super(AddVariation, self).dispatch(request, *args, **kwargs)