diff --git a/.travis.yml b/.travis.yml index 4bf3634e..32ad431d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ env: - 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 + - DJANGO_VERSION=https://github.com/django/django/archive/stable/2.2.x.zip python: - "2.7" - "3.4" @@ -17,8 +18,12 @@ matrix: 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: "2.7" + env: DJANGO_VERSION=https://github.com/django/django/archive/stable/2.2.x.zip - python: "3.4" 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.2.x.zip install: - pip install $DJANGO_VERSION - pip install . diff --git a/forms_builder/example_project/settings.py b/forms_builder/example_project/settings.py index 27190666..767f6515 100644 --- a/forms_builder/example_project/settings.py +++ b/forms_builder/example_project/settings.py @@ -78,6 +78,7 @@ 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.staticfiles', + 'django.contrib.messages', 'forms_builder.forms', ) diff --git a/forms_builder/forms/models.py b/forms_builder/forms/models.py index 73c6ae3b..59b6d6bf 100644 --- a/forms_builder/forms/models.py +++ b/forms_builder/forms/models.py @@ -2,6 +2,7 @@ from django import VERSION as DJANGO_VERSION from django.contrib.sites.models import Site +from django.utils.html import format_html_join try: from django.urls import reverse @@ -142,16 +143,13 @@ def get_absolute_url(self): return reverse("form_detail", kwargs={"slug": self.slug}) def admin_links(self): - kw = {"args": (self.id,)} - links = [ + kw = {"args": (self.id, )} + return format_html_join("\n", "
", ( (_("View form on site"), self.get_absolute_url()), (_("Filter entries"), reverse("admin:form_entries", **kw)), (_("View all entries"), reverse("admin:form_entries_show", **kw)), (_("Export all entries"), reverse("admin:form_entries_export", **kw)), - ] - for i, (text, url) in enumerate(links): - links[i] = "%s" % (url, ugettext(text)) - return "