Skip to content

Commit

Permalink
fixes to Django 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrDlouhy committed Feb 1, 2020
1 parent 5893b4b commit 6ac0c04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions categories/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.contrib import admin
from django.db import models
from django import forms
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _

from mptt.models import MPTTModel
Expand All @@ -29,7 +29,6 @@ def active(self):
return self.get_queryset().filter(active=True)


@python_2_unicode_compatible
class CategoryBase(MPTTModel):
"""
This base model includes the absolute bare bones fields and methods. One
Expand Down
6 changes: 3 additions & 3 deletions categories/editor/tree_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from django.contrib.admin.options import IncorrectLookupParameters
from django.shortcuts import render_to_response
from django.shortcuts import render

import django

Expand Down Expand Up @@ -170,7 +170,7 @@ def old_changelist_view(self, request, extra_context=None):
# the 'invalid=1' parameter was already in the query string, something
# is screwed up with the database, so display an error page.
if ERROR_FLAG in list(request.GET.keys()):
return render_to_response(
return render(request,
'admin/invalid_setup.html', {'title': _('Database error')})
return HttpResponseRedirect(request.path + '?' + ERROR_FLAG + '=1')

Expand Down Expand Up @@ -262,7 +262,7 @@ def old_changelist_view(self, request, extra_context=None):
context['opts'] = self.model._meta

context.update(extra_context or {})
return render_to_response(self.change_list_template or [
return render(request, self.change_list_template or [
'admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()),
'admin/%s/change_list.html' % app_label,
'admin/change_list.html'
Expand Down
2 changes: 1 addition & 1 deletion categories/templatetags/category_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.apps import apps
from django.template import (Node, TemplateSyntaxError, VariableDoesNotExist)
from django.template.base import FilterExpression
from django.utils.six import string_types
from six import string_types
from categories.base import CategoryBase
from categories.models import Category
from mptt.utils import drilldown_tree_for_node
Expand Down

0 comments on commit 6ac0c04

Please sign in to comment.