Unverified Commit 2dca100d authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Fix migrations for Django 2.0

parent 20221b17
Django>=1.11,<2.0 Django>=2.0,<2.1
django-localflavor>=1.6,<1.7 django-localflavor>=1.6,<1.7
Pillow>=4.3.0,<4.5.0 Pillow>=4.3.0,<4.5.0
django-compressor>=2.1,<3 django-compressor>=2.1,<3
......
...@@ -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.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()),
],
),
]
...@@ -141,6 +141,9 @@ class Committee(models.Model, metaclass=ModelTranslateMeta): ...@@ -141,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()
......
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