Merge pull request #2524 from normanjaeckel/FixMigrations

Fixed migrations by skipping autoupdate.
This commit is contained in:
Emanuel Schütze 2016-10-24 19:22:49 +02:00 committed by GitHub
commit 6a1fc01a38
3 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ def convert_duration(apps, schema_editor):
if len(split) == 2 and is_int(split[0]) and is_int(split[1]): if len(split) == 2 and is_int(split[0]) and is_int(split[1]):
# duration = hours * 60 + minutes # duration = hours * 60 + minutes
item.duration_tmp = int(split[0]) * 60 + int(split[1]) item.duration_tmp = int(split[0]) * 60 + int(split[1])
item.save() item.save(skip_autoupdate=True)
def is_int(s): def is_int(s):

View File

@ -24,7 +24,7 @@ def move_custom_slides_to_topics(apps, schema_editor):
item = Item.objects.get(object_id=custom_slide.pk, content_type=content_type_custom_slide) item = Item.objects.get(object_id=custom_slide.pk, content_type=content_type_custom_slide)
item.object_id = topic.pk item.object_id = topic.pk
item.content_type = content_type_topic item.content_type = content_type_topic
item.save() item.save(skip_autoupdate=True)
# Delete old data. # Delete old data.
CustomSlide.objects.all().delete() CustomSlide.objects.all().delete()

View File

@ -22,7 +22,7 @@ def change_label_of_state(apps, schema_editor):
else: else:
state.name = 'refered to committee' state.name = 'refered to committee'
state.action_word = 'Refer to committee' state.action_word = 'Refer to committee'
state.save() state.save(skip_autoupdate=True)
def add_recommendation_labels(apps, schema_editor): def add_recommendation_labels(apps, schema_editor):
@ -46,7 +46,7 @@ def add_recommendation_labels(apps, schema_editor):
for state in State.objects.all(): for state in State.objects.all():
if name_label_map.get(state.name): if name_label_map.get(state.name):
state.recommendation_label = name_label_map[state.name] state.recommendation_label = name_label_map[state.name]
state.save() state.save(skip_autoupdate=True)
class Migration(migrations.Migration): class Migration(migrations.Migration):