Skip to content

Commit

Permalink
Merge branch 'develop' into feature/storage-i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Sep 14, 2018
2 parents 0beaf45 + fb2478b commit b66868b
Show file tree
Hide file tree
Showing 102 changed files with 2,914 additions and 4,071 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG
Expand Up @@ -2,6 +2,16 @@
Changelog
*********

0.155.0 (2018-09-12)
====================

- Admin: Add view for creating and managing RegistrationProviders.
- APIv2: Add view for claiming unregistered users.
- Show "reviews_state" on withdrawn preprints.
- Show "review_actions" on withdrawn preprints to moderators.
- Send registration parent information to SHARE.
- Rename CollectedGuidMetaData to CollectionSubmission.

0.154.0 (2018-09-09)
====================

Expand Down
3 changes: 2 additions & 1 deletion addons/wiki/migrations/0008_store_guid_on_nodewikipage.py
Expand Up @@ -3,13 +3,14 @@
from __future__ import unicode_literals
from django.db import migrations
from django.db import connection
from addons.wiki.models import NodeWikiPage
from django.contrib.contenttypes.models import ContentType

def reverse_func(state, schema):
NodeWikiPage = state.get_model('addons_wiki', 'nodewikipage')
return NodeWikiPage.objects.update(former_guid=None)

def add_guid_field(state, schema):
NodeWikiPage = state.get_model('addons_wiki', 'nodewikipage')
content_type_id = ContentType.objects.get_for_model(NodeWikiPage).id
with connection.cursor() as cursor:
cursor.execute(
Expand Down
13 changes: 11 additions & 2 deletions addons/wiki/migrations/0010_migrate_node_wiki_pages.py
Expand Up @@ -9,8 +9,8 @@
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from bulk_update.helper import bulk_update
from addons.wiki.models import WikiPage, NodeWikiPage, WikiVersion
from osf.models import Comment, Guid, AbstractNode
from addons.wiki.models import WikiPage, WikiVersion
from osf.models import Comment, Guid

logger = logging.getLogger(__name__)

Expand All @@ -20,6 +20,9 @@ def reverse_func(state, schema):
Reverses NodeWikiPage migration. Repoints guids back to each NodeWikiPage,
repoints comment_targets, comments_viewed_timestamps, and deletes all WikiVersions and WikiPages
"""
NodeWikiPage = state.get_model('addons_wiki', 'nodewikipage')
AbstractNode = state.get_model('osf', 'AbstractNode')

nwp_content_type_id = ContentType.objects.get_for_model(NodeWikiPage).id

nodes = AbstractNode.objects.exclude(wiki_pages_versions={})
Expand Down Expand Up @@ -88,6 +91,8 @@ def migrate_node_wiki_pages(state, schema):
migrate_guid_referent_sql(state, schema)

def create_wiki_pages_sql(state, schema):
NodeWikiPage = state.get_model('addons_wiki', 'nodewikipage')

then = time.time()
logger.info('Starting migration of WikiPages [SQL]:')
wikipage_content_type_id = ContentType.objects.get_for_model(WikiPage).id
Expand Down Expand Up @@ -193,6 +198,8 @@ def create_guids(state, schema):
return

def create_wiki_versions_and_repoint_comments_sql(state, schema):
NodeWikiPage = state.get_model('addons_wiki', 'nodewikipage')

then = time.time()
logger.info('Starting migration of WikiVersions [SQL]:')
nodewikipage_content_type_id = ContentType.objects.get_for_model(NodeWikiPage).id
Expand Down Expand Up @@ -417,6 +424,8 @@ def migrate_comments_viewed_timestamp_sql(state, schema):
logger.info('Finished migration of comments_viewed_timestamp [SQL]: {:.5} seconds'.format(now - then))

def migrate_guid_referent_sql(state, schema):
NodeWikiPage = state.get_model('addons_wiki', 'nodewikipage')

then = time.time()
logger.info('Starting migration of Node Wiki Page guids, repointing them to Wiki Page guids [SQL]:')
wikipage_content_type_id = ContentType.objects.get_for_model(WikiPage).id
Expand Down
26 changes: 26 additions & 0 deletions addons/wiki/migrations/0011_auto_20180415_1649.py
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-15 21:49
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('addons_wiki', '0010_migrate_node_wiki_pages'),
]

operations = [
migrations.RemoveField(
model_name='nodewikipage',
name='node',
),
migrations.RemoveField(
model_name='nodewikipage',
name='user',
),
migrations.DeleteModel(
name='NodeWikiPage',
),
]

0 comments on commit b66868b

Please sign in to comment.