From 58191614aaf9789a84ab02beed289e5bc98c6c08 Mon Sep 17 00:00:00 2001 From: Angelo Dini Date: Fri, 18 Nov 2016 11:09:27 +0100 Subject: [PATCH] adapted testing infrastructure, fixed migrations and docs --- .travis.yml | 12 +++++------ CHANGELOG.rst | 10 +++++++++ README.rst | 5 +---- .../migrations/0004_auto_20150708_1133.py | 3 ++- .../migrations/0010_adapted_fields.py | 4 ++-- .../migrations/0013_fix_hostname.py | 21 +++++++++++++++++++ djangocms_link/validators.py | 2 -- tox.ini | 6 +++--- 8 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 djangocms_link/migrations/0013_fix_hostname.py diff --git a/.travis.yml b/.travis.yml index 4ca66529..f7d97f32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,15 +7,15 @@ env: - TOX_ENV=py27-latest - TOX_ENV=py34-latest # Django 1.8 - - TOX_ENV=py34-dj18-cms33 - - TOX_ENV=py34-dj18-cms32 + - TOX_ENV=py27-dj18-cms34 - TOX_ENV=py27-dj18-cms33 - - TOX_ENV=py27-dj18-cms32 + - TOX_ENV=py34-dj18-cms34 + - TOX_ENV=py34-dj18-cms33 # Django 1.9 - - TOX_ENV=py34-dj19-cms33 - - TOX_ENV=py34-dj19-cms32 + - TOX_ENV=py27-dj19-cms34 - TOX_ENV=py27-dj19-cms33 - - TOX_ENV=py27-dj19-cms32 + - TOX_ENV=py34-dj19-cms34 + - TOX_ENV=py34-dj19-cms33 install: - pip install tox coverage diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c2081b46..c8f78724 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,16 @@ Changelog ========= +2.0.3 (unreleased) +================== +* Prevent changes to ``DJANGOCMS_LINK_XXX`` settings from requiring new + migrations +* Changed naming of ``Aldryn`` to ``Divio Cloud`` +* Adapted testing infrastructure (tox/travis) to incorporate + django CMS 3.4 and dropped 3.2 +* Removed NetBios Pattern from documentations as its faulty + + 2.0.2 (2016-10-31) ================== diff --git a/README.rst b/README.rst index f0c7ac90..34f844b8 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,7 @@ allows you to add links on your site. This plugin supports child plugins. If you add an other plugin as a child it will take this content instead of the link name as the content of the link. -This addon is compatible with `Aldryn `_ and is also available on the +This addon is compatible with `Divio Cloud `_ and is also available on the `django CMS Marketplace `_ for easy installation. @@ -78,9 +78,6 @@ For example: :: # RFC1123 Pattern: DJANGOCMS_LINK_INTRANET_HOSTNAME_PATTERN = r'[a-z,0-9,-]{1,15}' - # NetBios Pattern: - DJANGOCMS_LINK_INTRANET_HOSTNAME_PATTERN = r'[a-z,0-9,!@#$%^()\\-\'{}.~]{1,15}' - Either of these might accept a URL such as: :: http://SEARCHHOST/?q=some+search+string diff --git a/djangocms_link/migrations/0004_auto_20150708_1133.py b/djangocms_link/migrations/0004_auto_20150708_1133.py index d075d819..2700568e 100644 --- a/djangocms_link/migrations/0004_auto_20150708_1133.py +++ b/djangocms_link/migrations/0004_auto_20150708_1133.py @@ -3,6 +3,7 @@ from django.db import models, migrations import djangocms_link.validators +from djangocms_link.models import HOSTNAME class Migration(migrations.Migration): @@ -21,7 +22,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='link', name='url', - field=models.CharField(blank=True, max_length=2048, null=True, verbose_name='link', validators=[djangocms_link.validators.IntranetURLValidator(intranet_host_re=None)]), + field=models.CharField(blank=True, max_length=2048, null=True, verbose_name='link', validators=[djangocms_link.validators.IntranetURLValidator(intranet_host_re=HOSTNAME)]), preserve_default=True, ), ] diff --git a/djangocms_link/migrations/0010_adapted_fields.py b/djangocms_link/migrations/0010_adapted_fields.py index 92d4b58a..888cf066 100644 --- a/djangocms_link/migrations/0010_adapted_fields.py +++ b/djangocms_link/migrations/0010_adapted_fields.py @@ -4,7 +4,7 @@ from django.db import migrations, models import django.db.models.deletion import djangocms_attributes_field.fields -import djangocms_link.validators +from djangocms_link.models import get_templates class Migration(migrations.Migration): @@ -17,7 +17,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='link', name='template', - field=models.CharField(default='default', max_length=255, verbose_name='Template', choices=[('default', 'Default')]), + field=models.CharField(default=get_templates()[0][0], max_length=255, verbose_name='Template', choices=get_templates()), ), migrations.RenameField( model_name='link', diff --git a/djangocms_link/migrations/0013_fix_hostname.py b/djangocms_link/migrations/0013_fix_hostname.py new file mode 100644 index 00000000..03e9af1a --- /dev/null +++ b/djangocms_link/migrations/0013_fix_hostname.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import djangocms_link.validators +from djangocms_link.models import HOSTNAME + + +class Migration(migrations.Migration): + + dependencies = [ + ('djangocms_link', '0012_removed_null'), + ] + + operations = [ + migrations.AlterField( + model_name='link', + name='external_link', + field=models.URLField(blank=True, help_text='Provide a valid URL to an external website.', max_length=2040, verbose_name='External link', validators=[djangocms_link.validators.IntranetURLValidator(intranet_host_re=HOSTNAME)]), + ), + ] diff --git a/djangocms_link/validators.py b/djangocms_link/validators.py index ecc8240a..c9ea792b 100644 --- a/djangocms_link/validators.py +++ b/djangocms_link/validators.py @@ -13,8 +13,6 @@ class IntranetURLValidator(URLValidator): Some examples: RFC1123 Pattern DJANGOCMS_LINK_INTRANET_HOSTNAME_PATTERN = r'[a-z,0-9,-]{1,15}' - NetBios Pattern - DJANGOCMS_LINK_INTRANET_HOSTNAME_PATTERN = r'[a-z,0-9,!@#$%^()\\-\'{}.~]{1,15}' """ ul = '\u00a1-\uffff' # unicode letters range (must be a unicode string, not a raw string) diff --git a/tox.ini b/tox.ini index 2e806c9c..13357f33 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,8 @@ envlist = flake8 py{34,27}-latest - py{34,27}-dj18-cms{33,32} - py{34,27}-dj19-cms{33,32} + py{34,27}-dj18-cms{34,33} + py{34,27}-dj19-cms{34,33} skip_missing_interpreters=True @@ -14,8 +14,8 @@ deps = dj18: Django>=1.8,<1.9 dj19: Django>=1.9,<1.10 latest: django-cms - cms32: django-cms>=3.2,<3.3 cms33: django-cms>=3.3,<3.4 + cms34: django-cms>=3.4,<3.5 commands = {envpython} --version {env:COMMAND:coverage} erase