mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
Fix some Django deprecations
- Use simple_tag() instead of assignment_tag(). Assignments with simple_tag() works just like before. - When loading urls for application, specify application name during inclusion. - Use the reverse() method from django.urls which as moved from django.core.urlresolvers. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
7540266a29
commit
b8adb19e8b
@ -118,7 +118,7 @@ def _include_module_urls(module_import_path, module_name):
|
|||||||
try:
|
try:
|
||||||
urls.urlpatterns += [
|
urls.urlpatterns += [
|
||||||
django.conf.urls.url(
|
django.conf.urls.url(
|
||||||
r'', django.conf.urls.include(url_module, module_name))]
|
r'', django.conf.urls.include((url_module, module_name)))]
|
||||||
except ImportError:
|
except ImportError:
|
||||||
logger.debug('No URLs for %s', module_name)
|
logger.debug('No URLs for %s', module_name)
|
||||||
if cfg.debug:
|
if cfg.debug:
|
||||||
|
|||||||
@ -21,7 +21,7 @@ from plinth.modules.pagekite import utils
|
|||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
@register.assignment_tag
|
@register.simple_tag
|
||||||
def create_pagekite_service_url(service, kite_name):
|
def create_pagekite_service_url(service, kite_name):
|
||||||
"""Create a URL out of a pagekite service
|
"""Create a URL out of a pagekite service
|
||||||
|
|
||||||
|
|||||||
@ -20,9 +20,9 @@ Views for snapshot module.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.core.urlresolvers import reverse
|
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
|
from django.urls import reverse
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user