clean out some python2-isms
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.db.models import F
|
||||
from django.utils.module_loading import import_string
|
||||
|
@ -1,5 +1,3 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.contrib import admin
|
||||
|
||||
from wagtail_personalisation import models, rules
|
||||
|
@ -1,5 +1,3 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from wagtail_personalisation import views
|
||||
|
@ -1,5 +1,3 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from wagtail.core import blocks
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from datetime import datetime
|
||||
from importlib import import_module
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
import logging
|
||||
|
||||
import re
|
||||
@ -13,7 +12,6 @@ from django.db import models
|
||||
from django.template.defaultfilters import slugify
|
||||
from django.test.client import RequestFactory
|
||||
from django.utils import timezone
|
||||
from django.utils.encoding import force_text, python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from modelcluster.fields import ParentalKey
|
||||
from user_agents import parse
|
||||
@ -43,7 +41,6 @@ def get_geoip_module():
|
||||
'warning if you use one of those.')
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class AbstractBaseRule(models.Model):
|
||||
"""Base for creating rules to segment users with."""
|
||||
icon = 'fa-circle-o'
|
||||
@ -59,7 +56,7 @@ class AbstractBaseRule(models.Model):
|
||||
verbose_name = 'Abstract segmentation rule'
|
||||
|
||||
def __str__(self):
|
||||
return force_text(self._meta.verbose_name)
|
||||
return str(self._meta.verbose_name)
|
||||
|
||||
def test_user(self):
|
||||
"""Test if the user matches this rule."""
|
||||
@ -67,7 +64,7 @@ class AbstractBaseRule(models.Model):
|
||||
|
||||
def encoded_name(self):
|
||||
"""Return a string with a slug for the rule."""
|
||||
return slugify(force_text(self).lower())
|
||||
return slugify(str(self).lower())
|
||||
|
||||
def description(self):
|
||||
"""Return a description explaining the functionality of the rule.
|
||||
|
Reference in New Issue
Block a user