SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 51b2f664 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Migrations comply with Django 1.11

parent 18df2f2b
No related branches found
No related tags found
No related merge requests found
...@@ -11,10 +11,10 @@ from guardian.shortcuts import assign_perm ...@@ -11,10 +11,10 @@ from guardian.shortcuts import assign_perm
def update_all_contenttypes(**kwargs): def update_all_contenttypes(**kwargs):
from django.apps import apps from django.apps import apps
from django.contrib.contenttypes.management import update_contenttypes from django.contrib.contenttypes.management import create_contenttypes
for app_config in apps.get_app_configs(): for app_config in apps.get_app_configs():
update_contenttypes(app_config, **kwargs) create_contenttypes(app_config, **kwargs)
def create_all_permissions(**kwargs): def create_all_permissions(**kwargs):
......
...@@ -6,8 +6,6 @@ from django.db import migrations ...@@ -6,8 +6,6 @@ from django.db import migrations
from guardian.shortcuts import assign_perm from guardian.shortcuts import assign_perm
from ..models import Report
def do_nothing(apps, schema_editor): def do_nothing(apps, schema_editor):
return return
...@@ -18,7 +16,7 @@ def update_eic_permissions(apps, schema_editor): ...@@ -18,7 +16,7 @@ def update_eic_permissions(apps, schema_editor):
Grant EIC of submission related to unvetted Reports Grant EIC of submission related to unvetted Reports
permission to vet his submission's Report. permission to vet his submission's Report.
""" """
# Report = apps.get_model('submissions', 'Report') -- This doesn't work due to shitty imports Report = apps.get_model('submissions', 'Report')
count = 0 count = 0
for rep in Report.objects.filter(status='unvetted'): for rep in Report.objects.filter(status='unvetted'):
eic_user = rep.submission.editor_in_charge eic_user = rep.submission.editor_in_charge
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment