Skip to content

Commit

Permalink
Remove custom wagtail page form
Browse files Browse the repository at this point in the history
THe older page form allowed to change segment settings inline but since
support for this was temporarily removed in an earlier commit we can
clean this up too
  • Loading branch information
mvantellingen committed Jun 1, 2017
1 parent dda0bc7 commit 29001fa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 51 deletions.
43 changes: 0 additions & 43 deletions src/wagtail_personalisation/forms.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-01 11:48
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('wagtail_personalisation', '0011_personalisablepagemetadata'),
]

operations = [
migrations.RemoveField(
model_name='personalisablepagemetadata',
name='is_segmented',
),
]
10 changes: 2 additions & 8 deletions src/wagtail_personalisation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
from django.utils.translation import ugettext_lazy as _
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
from wagtail.wagtailcore.models import Page
from wagtail.utils.decorators import cached_classmethod
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel, FieldRowPanel, InlinePanel, MultiFieldPanel, ObjectList,
PageChooserPanel, TabbedInterface)
from wagtail.wagtailcore.models import Page

from wagtail_personalisation.forms import AdminPersonalisablePageForm
from wagtail_personalisation.rules import AbstractBaseRule
from wagtail_personalisation.utils import count_active_days

Expand Down Expand Up @@ -115,10 +114,6 @@ class PersonalisablePageMetadata(ClusterableModel):
segment = models.ForeignKey(
Segment, related_name='page_metadata', null=True, blank=True)

is_segmented = models.BooleanField(default=False)

base_form_class = AdminPersonalisablePageForm

@cached_property
def has_variations(self):
"""Return a boolean indicating whether or not the personalisable page
Expand Down Expand Up @@ -170,8 +165,7 @@ def copy_for_segment(self, segment):
PersonalisablePageMetadata.objects.create(
canonical_page=page,
variant=new_page,
segment=segment,
is_segmented=True)
segment=segment)
return new_page

def variants_for_segments(self, segments):
Expand Down

0 comments on commit 29001fa

Please sign in to comment.