Skip to content

Commit

Permalink
Cleanup compatibility shims
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Jan 9, 2018
1 parent bdfbfc4 commit 497ec74
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
8 changes: 1 addition & 7 deletions djangocms_blog/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
from .models import BlogCategory, Post
from .settings import get_setting

try:
from admin_enhancer.admin import EnhancedModelAdminMixin
except ImportError:
class EnhancedModelAdminMixin(object):
pass


class SiteListFilter(admin.SimpleListFilter):
title = _('site')
Expand All @@ -55,7 +49,7 @@ def queryset(self, request, queryset):
raise admin.options.IncorrectLookupParameters(e)


class BlogCategoryAdmin(EnhancedModelAdminMixin, ModelAppHookConfig, TranslatableAdmin):
class BlogCategoryAdmin(ModelAppHookConfig, TranslatableAdmin):
form = CategoryAdminForm
list_display = [
'name', 'parent', 'app_config', 'all_languages_column',
Expand Down
10 changes: 5 additions & 5 deletions djangocms_blog/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import HTMLParser

h = HTMLParser.HTMLParser()
except ImportError:
from html.parser import HTMLParser
unescape = h.unescape

h = HTMLParser()
except ImportError:
from html import unescape


class LatestEntriesFeed(Feed):
Expand Down Expand Up @@ -123,13 +123,13 @@ def add_item_elements(self, handler, item):

handler.startElement('description', {})
handler._write('<![CDATA[{0}]]>'.format(
h.unescape(normalize_newlines(force_text(item['abstract'])).replace('\n', ' ')))
unescape(normalize_newlines(force_text(item['abstract'])).replace('\n', ' ')))
)
handler.endElement('description')
handler.startElement('content:encoded', {})
handler._write('<![CDATA[')
handler._write('<!doctype html>')
handler._write(h.unescape(force_text(item['content'])))
handler._write(unescape(force_text(item['content'])))
handler._write(']]>')
handler.endElement('content:encoded')

Expand Down
2 changes: 2 additions & 0 deletions djangocms_blog/search_indexes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals

from aldryn_search.helpers import get_plugin_index_data
from aldryn_search.utils import get_index_base, strip_tags
from django.utils.encoding import force_text
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
Expand Down

0 comments on commit 497ec74

Please sign in to comment.