diff --git a/src/personalisation/models.py b/src/personalisation/models.py index 0ea9166..66a01ed 100644 --- a/src/personalisation/models.py +++ b/src/personalisation/models.py @@ -64,7 +64,7 @@ class TimeRule(AbstractBaseRule): return starting_time <= current_time <= ending_time def __str__(self): - return 'Time Rule' + return _('Time Rule') @python_2_unicode_compatible @@ -90,7 +90,7 @@ class ReferralRule(AbstractBaseRule): return False def __str__(self): - return 'Referral Rule' + return _('Referral Rule') @python_2_unicode_compatible @@ -148,7 +148,7 @@ class VisitCountRule(AbstractBaseRule): return False def __str__(self): - return 'Visit count Rule' + return _('Visit count Rule') @python_2_unicode_compatible @@ -177,7 +177,7 @@ class QueryRule(AbstractBaseRule): return False def __str__(self): - return 'Query Rule' + return _('Query Rule') @python_2_unicode_compatible @@ -196,7 +196,7 @@ class UserIsLoggedInRule(AbstractBaseRule): return request.user.is_authenticated() == self.is_logged_in def __str__(self): - return '{}'.format(self.is_logged_in) + return _('Logged In Rule') @python_2_unicode_compatible diff --git a/src/personalisation/wagtail_hooks.py b/src/personalisation/wagtail_hooks.py index f6c0f42..8836252 100644 --- a/src/personalisation/wagtail_hooks.py +++ b/src/personalisation/wagtail_hooks.py @@ -41,7 +41,6 @@ class SegmentModelAdmin(ModelAdmin): index_view_extra_css = ['personalisation/segment/index.css'] form_view_extra_css = ['personalisation/segment/form.css'] - modeladmin_register(SegmentModelAdmin) @@ -83,7 +82,6 @@ def segment_user(page, request, serve_args, serve_kwargs): segments_adapter.refresh() - @hooks.register('before_serve_page') def serve_variation(page, request, serve_args, serve_kwargs): user_segments = []