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:
Sunil Mohan Adapa 2017-09-27 16:58:39 +05:30 committed by James Valleroy
parent 7540266a29
commit b8adb19e8b
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
3 changed files with 3 additions and 3 deletions

View File

@ -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:

View File

@ -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

View File

@ -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