Conditions | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | from django.db import migrations |
||
4 | def forward_copy_data(apps, schema_editor): |
||
5 | TestCase = apps.get_model('testcases', 'TestCase') |
||
6 | |||
7 | for test_case in TestCase.objects.all(): |
||
8 | history = test_case.history.latest() |
||
9 | |||
10 | # In 0006_merge_text_field_into_testcase_model we may have |
||
11 | # failed to save the text into the history record leaving |
||
12 | # historical records with text == None. |
||
13 | # If the TC was not modified since then we try to fix the last |
||
14 | # historical record |
||
15 | if test_case.text and not history.text: |
||
16 | history.text = test_case.text |
||
17 | history.save() |
||
18 | |||
30 |