Merge "Django 2.0 support"

This commit is contained in:
Zuul 2018-05-21 03:09:03 +00:00 committed by Gerrit Code Review
commit 3ba7019844
5 changed files with 18 additions and 7 deletions

View File

@ -4,6 +4,12 @@
check:
jobs:
- openstack-tox-lower-constraints
- horizon-openstack-tox-py35dj20:
required-projects:
openstack/horizon
gate:
jobs:
- openstack-tox-lower-constraints
- horizon-openstack-tox-py35dj20:
required-projects:
openstack/horizon

View File

@ -11,7 +11,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.core import urlresolvers
from django import urls
from django.utils.translation import ugettext_lazy as _ # noqa
from django.utils.translation import ungettext_lazy
@ -118,7 +118,7 @@ class CreateRecord(tables.LinkAction):
def get_link_url(self, datum=None):
url = "horizon:project:dns_domains:create_record"
return urlresolvers.reverse(url, kwargs=self.table.kwargs)
return urls.reverse(url, kwargs=self.table.kwargs)
class EditRecord(tables.LinkAction):
@ -136,7 +136,7 @@ class EditRecord(tables.LinkAction):
'record_id': datum.id,
}
return urlresolvers.reverse(url, kwargs=kwargs)
return urls.reverse(url, kwargs=kwargs)
def allowed(self, request, record=None):
return record.type in EDITABLE_RECORD_TYPES
@ -227,7 +227,7 @@ class DomainsTable(tables.DataTable):
def record__details_link(record):
'''Returns a link to the view for updating DNS records.'''
return urlresolvers.reverse(
return urls.reverse(
"horizon:project:dns_domains:view_record",
args=(record.domain_id, record.id))

View File

@ -11,7 +11,8 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.core.urlresolvers import reverse, reverse_lazy # noqa
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ # noqa
from horizon import exceptions

View File

@ -17,8 +17,6 @@
# under the License.
from __future__ import unicode_literals
from django.core.urlresolvers import reverse # noqa
from designatedashboard.tests import base
DOMAIN_ID = '123'

View File

@ -52,3 +52,9 @@ deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
[testenv:py35dj20]
basepython = python3.5
commands =
pip install django>=2.0,<2.1
{[testenv]commands}