diff --git a/mayan/apps/checkouts/migrations/0003_auto_20150617_0325.py b/mayan/apps/checkouts/migrations/0003_auto_20150617_0325.py index 055e67e651..fae5240e3f 100644 --- a/mayan/apps/checkouts/migrations/0003_auto_20150617_0325.py +++ b/mayan/apps/checkouts/migrations/0003_auto_20150617_0325.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals from django.db import migrations -def move_from_content_type_user_to_foreign_key_field_user(apps, schema_editor): +def operation_move_from_content_type_user_to_foreign_key_field_user(apps, schema_editor): # The model references the use who checked out the document using a # generic.GenericForeignKey. This migrations changes that to a simpler # ForeignKey to the User model @@ -24,6 +24,6 @@ class Migration(migrations.Migration): operations = [ migrations.RunPython( - move_from_content_type_user_to_foreign_key_field_user + code=operation_move_from_content_type_user_to_foreign_key_field_user ), ] diff --git a/mayan/apps/document_comments/migrations/0003_auto_20150729_2144.py b/mayan/apps/document_comments/migrations/0003_auto_20150729_2144.py index 3ed17617db..58f4ca53fc 100644 --- a/mayan/apps/document_comments/migrations/0003_auto_20150729_2144.py +++ b/mayan/apps/document_comments/migrations/0003_auto_20150729_2144.py @@ -4,7 +4,7 @@ from django.conf import settings from django.db import migrations -def migrate_old_comments(apps, schema_editor): +def operation_migrate_old_comments(apps, schema_editor): # https://code.djangoproject.com/ticket/24282 # If someone has a better solution until Django 1.8, would appreciate # a pull-request :) @@ -43,5 +43,5 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPython(migrate_old_comments), + migrations.RunPython(code=operation_migrate_old_comments), ] diff --git a/mayan/apps/document_indexing/migrations/0006_auto_20150729_0144.py b/mayan/apps/document_indexing/migrations/0006_auto_20150729_0144.py index 0f595b7956..9481be2888 100644 --- a/mayan/apps/document_indexing/migrations/0006_auto_20150729_0144.py +++ b/mayan/apps/document_indexing/migrations/0006_auto_20150729_0144.py @@ -4,7 +4,7 @@ from django.db import migrations from django.template.defaultfilters import slugify -def assign_slugs(apps, schema_editor): +def operation_assign_slugs(apps, schema_editor): Index = apps.get_model('document_indexing', 'Index') for index in Index.objects.using(schema_editor.connection.alias).all(): @@ -19,5 +19,5 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPython(assign_slugs), + migrations.RunPython(code=operation_assign_slugs), ] diff --git a/mayan/apps/document_parsing/migrations/0003_documenttypesettings.py b/mayan/apps/document_parsing/migrations/0003_documenttypesettings.py index 95931de955..8315a52e5b 100644 --- a/mayan/apps/document_parsing/migrations/0003_documenttypesettings.py +++ b/mayan/apps/document_parsing/migrations/0003_documenttypesettings.py @@ -4,7 +4,7 @@ import django.db.models.deletion from django.db import migrations, models -def create_parsing_setting_for_existing_document_types(apps, schema_editor): +def operation_create_parsing_setting_for_existing_document_types(apps, schema_editor): DocumentType = apps.get_model('documents', 'DocumentType') DocumentTypeSettings = apps.get_model( 'document_parsing', 'DocumentTypeSettings' @@ -19,7 +19,7 @@ def create_parsing_setting_for_existing_document_types(apps, schema_editor): pass -def delete_parsing_setting_for_existing_document_types(apps, schema_editor): +def operation_delete_parsing_setting_for_existing_document_types(apps, schema_editor): DocumentType = apps.get_model('documents', 'DocumentType') DocumentTypeSettings = apps.get_model( 'document_parsing', 'DocumentTypeSettings' @@ -72,7 +72,7 @@ class Migration(migrations.Migration): }, ), migrations.RunPython( - code=create_parsing_setting_for_existing_document_types, - reverse_code=delete_parsing_setting_for_existing_document_types, + code=operation_create_parsing_setting_for_existing_document_types, + reverse_code=operation_delete_parsing_setting_for_existing_document_types, ) ] diff --git a/mayan/apps/document_states/migrations/0004_workflow_internal_name.py b/mayan/apps/document_states/migrations/0004_workflow_internal_name.py index de5c8943a9..40d2159f05 100644 --- a/mayan/apps/document_states/migrations/0004_workflow_internal_name.py +++ b/mayan/apps/document_states/migrations/0004_workflow_internal_name.py @@ -6,7 +6,7 @@ from django.utils.text import slugify from mayan.apps.common.validators import validate_internal_name -def generate_internal_name(apps, schema_editor): +def operation_generate_internal_name(apps, schema_editor): Workflow = apps.get_model('document_states', 'Workflow') internal_names = [] @@ -48,7 +48,7 @@ class Migration(migrations.Migration): # Generate the slugs based on the labels migrations.RunPython( - generate_internal_name, reverse_code=migrations.RunPython.noop + code=operation_generate_internal_name, reverse_code=migrations.RunPython.noop ), # Make the internal name field unique diff --git a/mayan/apps/events/migrations/0005_auto_20170731_0452.py b/mayan/apps/events/migrations/0005_auto_20170731_0452.py index f2ab813adf..7ab230b8ce 100644 --- a/mayan/apps/events/migrations/0005_auto_20170731_0452.py +++ b/mayan/apps/events/migrations/0005_auto_20170731_0452.py @@ -7,7 +7,7 @@ import re from django.db import migrations -def update_event_types_names(apps, schema_editor): +def operation_update_event_types_names(apps, schema_editor): Action = apps.get_model('actstream', 'Action') StoredEventType = apps.get_model('events', 'StoredEventType') @@ -35,7 +35,7 @@ def update_event_types_names(apps, schema_editor): action.save() -def revert_event_types_names(apps, schema_editor): +def operation_revert_event_types_names(apps, schema_editor): Action = apps.get_model('actstream', 'Action') StoredEventType = apps.get_model('events', 'StoredEventType') @@ -80,7 +80,7 @@ class Migration(migrations.Migration): operations = [ migrations.RunPython( - code=update_event_types_names, - reverse_code=revert_event_types_names + code=operation_update_event_types_names, + reverse_code=operation_revert_event_types_names ), ] diff --git a/mayan/apps/ocr/migrations/0003_auto_20150617_0401.py b/mayan/apps/ocr/migrations/0003_auto_20150617_0401.py index 4fc8a85c34..1fd4872641 100644 --- a/mayan/apps/ocr/migrations/0003_auto_20150617_0401.py +++ b/mayan/apps/ocr/migrations/0003_auto_20150617_0401.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals from django.db import migrations -def move_content_from_documents_to_ocr_app(apps, schema_editor): +def operation_move_content_from_documents_to_ocr_app(apps, schema_editor): DocumentPage = apps.get_model('documents', 'DocumentPage') DocumentPageContent = apps.get_model('ocr', 'DocumentPageContent') @@ -22,5 +22,5 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPython(move_content_from_documents_to_ocr_app), + migrations.RunPython(code=operation_move_content_from_documents_to_ocr_app), ] diff --git a/mayan/apps/ocr/migrations/0004_documenttypesettings.py b/mayan/apps/ocr/migrations/0004_documenttypesettings.py index f0593988b7..c01423131d 100644 --- a/mayan/apps/ocr/migrations/0004_documenttypesettings.py +++ b/mayan/apps/ocr/migrations/0004_documenttypesettings.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals from django.db import models, migrations -def create_ocr_setting_for_existing_document_types(apps, schema_editor): +def operation_create_ocr_setting_for_existing_document_types(apps, schema_editor): DocumentType = apps.get_model('documents', 'DocumentType') DocumentTypeSettings = apps.get_model('ocr', 'DocumentTypeSettings') @@ -55,5 +55,5 @@ class Migration(migrations.Migration): }, bases=(models.Model,), ), - migrations.RunPython(create_ocr_setting_for_existing_document_types), + migrations.RunPython(code=operation_create_ocr_setting_for_existing_document_types), ] diff --git a/mayan/apps/sources/migrations/0019_auto_20180803_0440.py b/mayan/apps/sources/migrations/0019_auto_20180803_0440.py index fdfb39b667..3f1b550eea 100644 --- a/mayan/apps/sources/migrations/0019_auto_20180803_0440.py +++ b/mayan/apps/sources/migrations/0019_auto_20180803_0440.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals from django.db import migrations, models -def make_labels_unique(apps, schema_editor): +def operation_make_labels_unique(apps, schema_editor): Source = apps.get_model('sources', 'Source') for source in Source.objects.using(schema_editor.connection.alias).all(): @@ -18,7 +18,7 @@ def make_labels_unique(apps, schema_editor): source.save() -def make_labels_unique_reverse(apps, schema_editor): +def operation_make_labels_unique_reverse(apps, schema_editor): Source = apps.get_model('sources', 'Source') for source in Source.objects.using(schema_editor.connection.alias).all(): @@ -35,7 +35,7 @@ class Migration(migrations.Migration): operations = [ migrations.RunPython( - make_labels_unique, reverse_code=make_labels_unique_reverse + code=operation_make_labels_unique, reverse_code=operation_make_labels_unique_reverse ), migrations.AlterField( model_name='source', diff --git a/mayan/apps/tags/migrations/0002_tag_selection.py b/mayan/apps/tags/migrations/0002_tag_selection.py index 126e5bc239..48b2ec4fdb 100644 --- a/mayan/apps/tags/migrations/0002_tag_selection.py +++ b/mayan/apps/tags/migrations/0002_tag_selection.py @@ -31,7 +31,7 @@ RGB_VALUES = { } -def convert_color_names_to_rgb(apps, schema_editor): +def operation_convert_color_names_to_rgb(apps, schema_editor): Tag = apps.get_model('tags', 'Tag') for tag in Tag.objects.using(schema_editor.connection.alias).all(): @@ -52,5 +52,5 @@ class Migration(migrations.Migration): field=colorful.fields.RGBColorField(default='#FFFFFF'), preserve_default=False, ), - migrations.RunPython(convert_color_names_to_rgb), + migrations.RunPython(code=operation_convert_color_names_to_rgb), ] diff --git a/mayan/apps/user_management/migrations/0001_initial.py b/mayan/apps/user_management/migrations/0001_initial.py index 550c7af189..a0b46b6282 100644 --- a/mayan/apps/user_management/migrations/0001_initial.py +++ b/mayan/apps/user_management/migrations/0001_initial.py @@ -7,7 +7,7 @@ from django.db import migrations, models import django.db.models.deletion -def add_user_options_to_existing_users(apps, schema_editor): +def operation_add_user_options_to_existing_users(apps, schema_editor): User = apps.get_model(settings.AUTH_USER_MODEL) UserOptions = apps.get_model( app_label='user_management', model_name='UserOptions' @@ -19,7 +19,7 @@ def add_user_options_to_existing_users(apps, schema_editor): ).create(user=user) -def remove_user_options_from_existing_users(apps, schema_editor): +def operation_remove_user_options_from_existing_users(apps, schema_editor): User = apps.get_model(settings.AUTH_USER_MODEL) UserOptions = apps.get_model( app_label='user_management', model_name='UserOptions' @@ -53,7 +53,7 @@ class Migration(migrations.Migration): }, ), migrations.RunPython( - code=add_user_options_to_existing_users, - reverse_code=remove_user_options_from_existing_users + code=operation_add_user_options_to_existing_users, + reverse_code=operation_remove_user_options_from_existing_users ), ]