We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b3ac2a commit 46ab91eCopy full SHA for 46ab91e
1 file changed
ietf/message/migrations/0010_fix_content_type.py
@@ -0,0 +1,34 @@
1
+# Copyright The IETF Trust 2020, All Rights Reserved
2
+# -*- coding: utf-8 -*-
3
+# Generated by Django 1.11.20 on 2019-05-21 14:27
4
+
5
6
+from __future__ import absolute_import, print_function, unicode_literals
7
8
+from tqdm import tqdm
9
10
+from django.db import migrations
11
12
+import debug # pyflakes:ignore
13
14
15
+def forward(apps, schema_editor):
16
17
+ Message = apps.get_model('message', 'Message')
18
19
+ for m in tqdm(Message.objects.filter(content_type='')):
20
+ m.content_type = 'text/plain'
21
+ m.save()
22
23
+def reverse(apps, schema_editor):
24
+ pass
25
26
+class Migration(migrations.Migration):
27
28
+ dependencies = [
29
+ ('message', '0009_fix_address_lists'),
30
+ ]
31
32
+ operations = [
33
+ migrations.RunPython(forward, reverse),
34
0 commit comments