Skip to content

Commit a231801

Browse files
authored
Fixed deprecation warnings for Django 3.0.
1 parent 3734e9a commit a231801

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# -*- coding: utf-8 -*-
22
from django import template
3-
from django.utils.http import urlquote
3+
from django.utils.http import quote
44

55
register = template.Library()
66

77

88
@register.simple_tag
99
def pie_chart(items, width=440, height=190):
1010
return '//chart.googleapis.com/chart?cht=p3&chd=t:{0}&chs={1}x{2}&chl={3}'.format(
11-
urlquote(','.join([str(item[1]) for item in items])),
11+
quote(','.join([str(item[1]) for item in items])),
1212
width,
1313
height,
14-
urlquote('|'.join([str(item[0]) for item in items])),
14+
quote('|'.join([str(item[0]) for item in items])),
1515
)

request/traffic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import django
55
from django.core.exceptions import ImproperlyConfigured
66
from django.db.models import Count
7+
from django.utils.translation import gettext
78
from django.utils.translation import gettext_lazy as _
8-
from django.utils.translation import ugettext
99

1010
from . import settings
1111
from .utils import get_verbose_name
@@ -69,7 +69,7 @@ def graph(self, days):
6969
'''
7070
return tuple([{
7171
'data': [(mktime(day.timetuple()) * 1000, module.count(qs)) for day, qs in days],
72-
'label': str(ugettext(module.verbose_name_plural)),
72+
'label': str(gettext(module.verbose_name_plural)),
7373
} for module in self.modules])
7474

7575

0 commit comments

Comments
 (0)