Skip to content

Commit 54961f5

Browse files
committed
Merge branch 'django-1.9-compat' from @dulaccc into master
2 parents f9f50b1 + 042ca54 commit 54961f5

16 files changed

+62
-18
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
language: python
22
python: "2.7"
3+
sudo: false
34

45
env:
56
- TOX_ENV=py26-django14
@@ -10,6 +11,7 @@ env:
1011
- TOX_ENV=py27-django16
1112
- TOX_ENV=py27-django17
1213
- TOX_ENV=py27-django18
14+
- TOX_ENV=py27-django19
1315
- TOX_ENV=py33-django15
1416
- TOX_ENV=py33-django16
1517
- TOX_ENV=py33-django17
@@ -18,6 +20,7 @@ env:
1820
- TOX_ENV=py34-django16
1921
- TOX_ENV=py34-django17
2022
- TOX_ENV=py34-django18
23+
- TOX_ENV=py34-django19
2124
- TOX_ENV=docs
2225

2326
install:

oauth2_provider/compat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@
3737
get_model = apps.get_model
3838
except ImportError:
3939
from django.db.models import get_model
40+
41+
# Django 1.5 add the support of context variables for the url template tag
42+
if django.VERSION >= (1, 5):
43+
from django.template.defaulttags import url
44+
else:
45+
from django.templatetags.future import url

oauth2_provider/compat_handlers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Django 1.9 drops the NullHandler since Python 2.7 includes it
2+
try:
3+
from logging import NullHandler
4+
except ImportError:
5+
from django.utils.log import NullHandler

oauth2_provider/templates/oauth2_provider/application_confirm_delete.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "oauth2_provider/base.html" %}
22

33
{% load i18n %}
4-
{% load url from future %}
4+
{% load url from compat %}
55
{% block content %}
66
<div class="block-center">
77
<h3 class="block-center-heading">{% trans "Are you sure to delete the application" %} {{ application.name }}?</h3>

oauth2_provider/templates/oauth2_provider/application_detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "oauth2_provider/base.html" %}
22

33
{% load i18n %}
4-
{% load url from future %}
4+
{% load url from compat %}
55
{% block content %}
66
<div class="block-center">
77
<h3 class="block-center-heading">{{ application.name }}</h3>

oauth2_provider/templates/oauth2_provider/application_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "oauth2_provider/base.html" %}
22

33
{% load i18n %}
4-
{% load url from future %}
4+
{% load url from compat %}
55
{% block content %}
66
<div class="block-center">
77
<form class="form-horizontal" method="post" action="{% block app-form-action-url %}{% url 'oauth2_provider:update' application.id %}{% endblock app-form-action-url %}">

oauth2_provider/templates/oauth2_provider/application_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "oauth2_provider/base.html" %}
22

33
{% load i18n %}
4-
{% load url from future %}
4+
{% load url from compat %}
55
{% block content %}
66
<div class="block-center">
77
<h3 class="block-center-heading">{% trans "Your applications" %}</h3>

oauth2_provider/templates/oauth2_provider/application_registration_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "oauth2_provider/application_form.html" %}
22

33
{% load i18n %}
4-
{% load url from future %}
4+
{% load url from compat %}
55

66
{% block app-form-title %}{% trans "Register a new application" %}{% endblock app-form-title %}
77

oauth2_provider/templatetags/__init__.py

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from django import template
2+
3+
from ..compat import url as url_compat
4+
5+
register = template.Library()
6+
7+
8+
@register.tag
9+
def url(parser, token):
10+
return url_compat(parser, token)

0 commit comments

Comments
 (0)