Skip to content

Commit

Permalink
migracion de correccion de callable str
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Wolfsdorf committed Nov 6, 2019
1 parent f8b498e commit b3c6bf6
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations


def convert_callable_str(apps, _schema_editor):
stage_model = apps.get_model('django_datajsonar', 'Stage')
stages = stage_model.objects.filter(callable_str__contains=".tasks.")
for stage in stages:
stage.callable_str = stage.callable_str.replace(".tasks.", ".federation_tasks.")
stage.save()


class Migration(migrations.Migration):

dependencies = [
('dashboard', '0057_federation_task_callable_str_migration'),
]

operations = [
migrations.RunPython(convert_callable_str, migrations.RunPython.noop)
]

0 comments on commit b3c6bf6

Please sign in to comment.