Skip to content

Commit

Permalink
Merge pull request #234 from maltalk/django2.1
Browse files Browse the repository at this point in the history
Django 2.1 compatibility
  • Loading branch information
stephenmcd committed Sep 17, 2018
2 parents 5b99075 + f50d854 commit 89fe031
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ env:
- DJANGO_VERSION=https://github.com/django/django/archive/stable/1.10.x.zip
- DJANGO_VERSION=https://github.com/django/django/archive/stable/1.11.x.zip
- DJANGO_VERSION=https://github.com/django/django/archive/stable/2.0.x.zip
- DJANGO_VERSION=https://github.com/django/django/archive/stable/2.1.x.zip
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
matrix:
exclude:
- python: "2.7"
env: DJANGO_VERSION=https://github.com/django/django/archive/stable/2.0.x.zip
- python: "2.7"
env: DJANGO_VERSION=https://github.com/django/django/archive/stable/2.1.x.zip
- python: "3.4"
env: DJANGO_VERSION=https://github.com/django/django/archive/stable/2.1.x.zip
install:
- pip install $DJANGO_VERSION
- pip install .
Expand Down
4 changes: 1 addition & 3 deletions forms_builder/forms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from django import VERSION as DJANGO_VERSION
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError

try:
from django.urls import reverse
Expand Down Expand Up @@ -139,9 +138,8 @@ def total_entries(self):
return self.total_entries
total_entries.admin_order_field = "total_entries"

@models.permalink
def get_absolute_url(self):
return ("form_detail", (), {"slug": self.slug})
return reverse("form_detail", kwargs={"slug": self.slug})

def admin_links(self):
kw = {"args": (self.id,)}
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"sphinx-me >= 0.1.2",
"unidecode",
"django-email-extras >= 0.2",
"django >= 1.8, < 2.1",
"django >= 1.8, < 2.2",
"future <= 0.15.0",
],
classifiers = [
Expand All @@ -63,6 +63,7 @@
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Framework :: Django",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Internet :: WWW/HTTP :: Site Management",
Expand Down

0 comments on commit 89fe031

Please sign in to comment.