Commit 75c50256 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'django-2' into 'master'

Django 2

Closes #521

See merge request !627
parents 2bfc0071 2dca100d
...@@ -35,6 +35,20 @@ python35-django11: ...@@ -35,6 +35,20 @@ python35-django11:
PYTHON_VERSION: py35 PYTHON_VERSION: py35
DJANGO_VERSION: django11 DJANGO_VERSION: django11
python35-django20:
<<: *djangotest
image: python:3.5
variables:
PYTHON_VERSION: py35
DJANGO_VERSION: django20
python36-django20:
<<: *djangotest
image: python:3.6
variables:
PYTHON_VERSION: py36
DJANGO_VERSION: django20
docs: docs:
image: $PY35_IMAGE image: $PY35_IMAGE
before_script: before_script:
......
Django>=1.11,<2.0 Django>=2.0,<2.1
django-localflavor>=1.4,<1.5 django-localflavor>=1.6,<1.7
Pillow>=4.1.0,<4.2.0 Pillow>=4.3.0,<4.5.0
django-compressor>=2.1,<3 django-compressor>=2.1,<3
django-sendfile<=0.4 django-sendfile<=0.4
freezegun>=0.3.9,<0.4.0 freezegun>=0.3.9,<0.4.0
django-template-check>=0.3.0 # This should be in dev-requirements somehow django-template-check>=0.3.0 # This should be in dev-requirements somehow
bleach>=2.0.0,<2.1 bleach>=2.1.0,<2.2
django-tinymce4-lite>=1.5,<1.6 django-tinymce4-lite>=1.6,<1.7
rcssmin>=1.0.6 rcssmin>=1.0.6
djangorestframework>=3.7,<3.8 djangorestframework>=3.7.1,<3.8
django-ical>=1.4,<2 django-ical>=1.4,<2
django-libsass>=0.7,<1 django-libsass>=0.7,<1
django-cors-headers>=2.0.0,<2.1 django-cors-headers>=2.1.0,<2.2
python-magic>=0.4.13,<0.5 python-magic>=0.4.13,<0.5
pyfcm>=1.4.2,<1.5 pyfcm>=1.4.2,<1.5
[tox] [tox]
envlist = flake8, {py34,py35}-django11, py36-django11 envlist = flake8, {py35,py36}-django11, {py35,py36}-django20
skipsdist = True skipsdist = True
skip_missing_interpreters = True skip_missing_interpreters = True
...@@ -20,6 +20,7 @@ deps = ...@@ -20,6 +20,7 @@ deps =
coverage coverage
pip-conflict-checker pip-conflict-checker
django11: django>=1.11b1,<1.12 django11: django>=1.11b1,<1.12
django20: django>=2.0rc1,<2.1
{env:CI_DEPS:} {env:CI_DEPS:}
passenv = passenv =
......
...@@ -7,6 +7,8 @@ from django.db import migrations ...@@ -7,6 +7,8 @@ from django.db import migrations
class Migration(migrations.Migration): class Migration(migrations.Migration):
atomic = False
dependencies = [ dependencies = [
('activemembers', '0007_mentors'), ('activemembers', '0007_mentors'),
] ]
......
...@@ -4,6 +4,8 @@ from __future__ import unicode_literals ...@@ -4,6 +4,8 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import activemembers.models
def remove_enddates(apps, schema_editor): def remove_enddates(apps, schema_editor):
Board = apps.get_model("activemembers", "Board") Board = apps.get_model("activemembers", "Board")
...@@ -21,5 +23,11 @@ class Migration(migrations.Migration): ...@@ -21,5 +23,11 @@ class Migration(migrations.Migration):
] ]
operations = [ operations = [
migrations.RunPython(remove_enddates) migrations.AlterModelManagers(
name='board',
managers=[
('objects', activemembers.models.BoardManager()),
],
),
migrations.RunPython(remove_enddates),
] ]
# Generated by Django 2.0rc1 on 2017-11-29 20:29
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('activemembers', '0023_auto_20171013_1416'),
]
operations = [
migrations.AlterField(
model_name='committee',
name='contact_mailinglist',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mailinglists.MailingList', verbose_name='contact mailing list'),
),
]
# Generated by Django 2.0.1 on 2018-01-08 11:53
import activemembers.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('activemembers', '0024_auto_20171129_2129'),
]
operations = [
migrations.AlterModelManagers(
name='board',
managers=[
('objects', activemembers.models.BoardManager()),
],
),
]
...@@ -104,6 +104,7 @@ class Committee(models.Model, metaclass=ModelTranslateMeta): ...@@ -104,6 +104,7 @@ class Committee(models.Model, metaclass=ModelTranslateMeta):
verbose_name=_('contact mailing list'), verbose_name=_('contact mailing list'),
null=True, null=True,
blank=True, blank=True,
on_delete=models.SET_NULL,
) )
wiki_namespace = models.CharField( wiki_namespace = models.CharField(
...@@ -140,6 +141,9 @@ class Committee(models.Model, metaclass=ModelTranslateMeta): ...@@ -140,6 +141,9 @@ class Committee(models.Model, metaclass=ModelTranslateMeta):
class BoardManager(models.Manager): class BoardManager(models.Manager):
use_in_migrations = True
def get_queryset(self): def get_queryset(self):
# sorting by descending order by default makes more sense for boards # sorting by descending order by default makes more sense for boards
return (super().get_queryset() return (super().get_queryset()
......
# Generated by Django 2.0rc1 on 2017-11-29 20:29
import datetime
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.query_utils
class Migration(migrations.Migration):
dependencies = [
('events', '0021_auto_20171013_1419'),
]
operations = [
migrations.AlterField(
model_name='registration',
name='member',
field=models.ForeignKey(blank=True, limit_choices_to=django.db.models.query_utils.Q(('membership__until__isnull', True), ('membership__until__gt', datetime.date(2017, 11, 29)), _connector='OR'), null=True, on_delete=django.db.models.deletion.CASCADE, to='members.Member'),
),
]
# Generated by Django 2.0.1 on 2018-01-08 11:49
import datetime
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.query_utils
class Migration(migrations.Migration):
dependencies = [
('events', '0022_auto_20171129_2129'),
]
operations = [
migrations.AlterField(
model_name='registration',
name='member',
field=models.ForeignKey(blank=True, limit_choices_to=django.db.models.query_utils.Q(('membership__until__isnull', True), ('membership__until__gt', datetime.date(2018, 1, 8)), _connector='OR'), null=True, on_delete=django.db.models.deletion.CASCADE, to='members.Member'),
),
]
...@@ -21,7 +21,9 @@ class Device(models.Model): ...@@ -21,7 +21,9 @@ class Device(models.Model):
help_text=_("Inactive devices will not be sent notifications") help_text=_("Inactive devices will not be sent notifications")
) )
user = models.ForeignKey(django_settings.AUTH_USER_MODEL, user = models.ForeignKey(django_settings.AUTH_USER_MODEL,
blank=False, null=False) on_delete=models.CASCADE,
blank=False,
null=False)
date_created = models.DateTimeField( date_created = models.DateTimeField(
verbose_name=_("registration date"), auto_now_add=True, null=False verbose_name=_("registration date"), auto_now_add=True, null=False
) )
......
...@@ -2,9 +2,10 @@ import uuid ...@@ -2,9 +2,10 @@ import uuid
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.core import urlresolvers, validators from django.core import validators
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.db import models from django.db import models
from django.urls import reverse
from django.utils import timezone from django.utils import timezone
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
...@@ -264,6 +265,7 @@ class Registration(Entry): ...@@ -264,6 +265,7 @@ class Registration(Entry):
class Renewal(Entry): class Renewal(Entry):
member = models.ForeignKey( member = models.ForeignKey(
'members.Member', 'members.Member',
on_delete=models.CASCADE,
verbose_name=_('member'), verbose_name=_('member'),
blank=False, blank=False,
null=False, null=False,
...@@ -390,7 +392,7 @@ class Payment(models.Model): ...@@ -390,7 +392,7 @@ class Payment(models.Model):
def get_admin_url(self): def get_admin_url(self):
content_type = ContentType.objects.get_for_model(self.__class__) content_type = ContentType.objects.get_for_model(self.__class__)
return urlresolvers.reverse("admin:%s_%s_change" % ( return reverse("admin:%s_%s_change" % (
content_type.app_label, content_type.model), args=(self.id,)) content_type.app_label, content_type.model), args=(self.id,))
class Meta: class Meta:
......
...@@ -174,7 +174,7 @@ REST_FRAMEWORK = { ...@@ -174,7 +174,7 @@ REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'DEFAULT_PAGINATION_CLASS':
'rest_framework.pagination.LimitOffsetPagination', 'rest_framework.pagination.LimitOffsetPagination',
'DEFAULT_VERSIONING_CLASS': 'DEFAULT_VERSIONING_CLASS':
'rest_framework.versioning.NamespaceVersioning', 'rest_framework.versioning.URLPathVersioning',
} }
# Internationalization # Internationalization
......
...@@ -105,7 +105,7 @@ urlpatterns = [ ...@@ -105,7 +105,7 @@ urlpatterns = [
url(r'^', include('mailinglists.api.urls')), url(r'^', include('mailinglists.api.urls')),
url(r'^', include('pizzas.api.urls')), url(r'^', include('pizzas.api.urls')),
url(r'^', include('pushnotifications.api.urls')), url(r'^', include('pushnotifications.api.urls')),
], namespace='v1')), ])),
])), ])),
url(r'^education/', include('education.urls')), url(r'^education/', include('education.urls')),
url(r'^announcements/', include('announcements.urls')), url(r'^announcements/', include('announcements.urls')),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment