From d84be3c8d690f6772b1b362c92ad73a8998b1e05 Mon Sep 17 00:00:00 2001 From: Dawn Pattison Date: Mon, 16 Jul 2018 07:55:18 -0500 Subject: [PATCH] Remove unneeded merge migration (pulled files-on-anything just added). Shift migrations to depend on latest added (0117_set_is_root). - See if is_quickfiles exists in update_file method (preprints don't have this attribute). --- osf/migrations/0116_merge_20180702_1607.py | 16 ---------------- ...=> 0118_update_preprint_model_for_divorce.py} | 2 +- ...dex.py => 0119_add_preprint_partial_index.py} | 2 +- ..._divorce.py => 0120_preprint_node_divorce.py} | 2 +- ...121_transfer_preprint_service_permissions.py} | 2 +- ...ds.py => 0122_remove_node_preprint_fields.py} | 2 +- website/search/elastic_search.py | 2 +- 7 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 osf/migrations/0116_merge_20180702_1607.py rename osf/migrations/{0117_update_preprint_model_for_divorce.py => 0118_update_preprint_model_for_divorce.py} (99%) rename osf/migrations/{0118_add_preprint_partial_index.py => 0119_add_preprint_partial_index.py} (91%) rename osf/migrations/{0119_preprint_node_divorce.py => 0120_preprint_node_divorce.py} (99%) rename osf/migrations/{0120_transfer_preprint_service_permissions.py => 0121_transfer_preprint_service_permissions.py} (98%) rename osf/migrations/{0121_remove_node_preprint_fields.py => 0122_remove_node_preprint_fields.py} (92%) diff --git a/osf/migrations/0116_merge_20180702_1607.py b/osf/migrations/0116_merge_20180702_1607.py deleted file mode 100644 index 2d1fa40b709..00000000000 --- a/osf/migrations/0116_merge_20180702_1607.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.13 on 2018-07-02 21:07 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('osf', '0115_auto_20180628_1253'), - ('osf', '0106_merge_20180531_0919'), - ] - - operations = [ - ] diff --git a/osf/migrations/0117_update_preprint_model_for_divorce.py b/osf/migrations/0118_update_preprint_model_for_divorce.py similarity index 99% rename from osf/migrations/0117_update_preprint_model_for_divorce.py rename to osf/migrations/0118_update_preprint_model_for_divorce.py index 27f274aa305..fb16349650a 100644 --- a/osf/migrations/0117_update_preprint_model_for_divorce.py +++ b/osf/migrations/0118_update_preprint_model_for_divorce.py @@ -15,7 +15,7 @@ class Migration(migrations.Migration): dependencies = [ - ('osf', '0116_merge_20180702_1607'), + ('osf', '0117_set_is_root'), ] operations = [ diff --git a/osf/migrations/0118_add_preprint_partial_index.py b/osf/migrations/0119_add_preprint_partial_index.py similarity index 91% rename from osf/migrations/0118_add_preprint_partial_index.py rename to osf/migrations/0119_add_preprint_partial_index.py index 76395d22505..1fe5ce1b48e 100644 --- a/osf/migrations/0118_add_preprint_partial_index.py +++ b/osf/migrations/0119_add_preprint_partial_index.py @@ -18,7 +18,7 @@ class Migration(migrations.Migration): dependencies = [ - ('osf', '0117_update_preprint_model_for_divorce'), + ('osf', '0118_update_preprint_model_for_divorce'), ] operations = [ diff --git a/osf/migrations/0119_preprint_node_divorce.py b/osf/migrations/0120_preprint_node_divorce.py similarity index 99% rename from osf/migrations/0119_preprint_node_divorce.py rename to osf/migrations/0120_preprint_node_divorce.py index 052c390be08..a41e53ca6d2 100644 --- a/osf/migrations/0119_preprint_node_divorce.py +++ b/osf/migrations/0120_preprint_node_divorce.py @@ -349,7 +349,7 @@ def divorce_preprints_from_nodes_sql(state, schema): class Migration(migrations.Migration): dependencies = [ - ('osf', '0118_add_preprint_partial_index'), + ('osf', '0119_add_preprint_partial_index'), ] operations = [ diff --git a/osf/migrations/0120_transfer_preprint_service_permissions.py b/osf/migrations/0121_transfer_preprint_service_permissions.py similarity index 98% rename from osf/migrations/0120_transfer_preprint_service_permissions.py rename to osf/migrations/0121_transfer_preprint_service_permissions.py index 3477b0d9c90..aea3fe4da58 100644 --- a/osf/migrations/0120_transfer_preprint_service_permissions.py +++ b/osf/migrations/0121_transfer_preprint_service_permissions.py @@ -37,7 +37,7 @@ def migrate_preprint_service_permissions(state, schema): class Migration(migrations.Migration): dependencies = [ - ('osf', '0119_preprint_node_divorce'), + ('osf', '0120_preprint_node_divorce'), ] operations = [ diff --git a/osf/migrations/0121_remove_node_preprint_fields.py b/osf/migrations/0122_remove_node_preprint_fields.py similarity index 92% rename from osf/migrations/0121_remove_node_preprint_fields.py rename to osf/migrations/0122_remove_node_preprint_fields.py index a08398e266e..55234b4dce5 100644 --- a/osf/migrations/0121_remove_node_preprint_fields.py +++ b/osf/migrations/0122_remove_node_preprint_fields.py @@ -8,7 +8,7 @@ class Migration(migrations.Migration): dependencies = [ - ('osf', '0120_transfer_preprint_service_permissions'), + ('osf', '0121_transfer_preprint_service_permissions'), ] operations = [ diff --git a/website/search/elastic_search.py b/website/search/elastic_search.py index 0c727d2398d..e16158639a0 100644 --- a/website/search/elastic_search.py +++ b/website/search/elastic_search.py @@ -681,7 +681,7 @@ def update_file(file_, index=None, delete=False): provider=file_.provider, path=file_.path, ) - if target.is_quickfiles: + if getattr(target, 'is_quickfiles', None): node_url = '/{user_id}/quickfiles/'.format(user_id=target.creator._id) else: node_url = '/{target_id}/'.format(target_id=target._id)