train spam on state change to 'closed_spam'
This commit is contained in:
parent
a6a8b0defe
commit
5a6349c5d3
3 changed files with 36 additions and 3 deletions
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('mail', '0005_alter_eventaddress_event'),
|
||||
]
|
||||
|
@ -13,8 +12,9 @@ class Migration(migrations.Migration):
|
|||
Email = apps.get_model('mail', 'Email')
|
||||
for email in Email.objects.all():
|
||||
raw_content = email.raw
|
||||
email.raw_file = ContentFile(raw_content)
|
||||
email.raw = None
|
||||
path = "mail_{}".format(email.id)
|
||||
if len(raw_content):
|
||||
email.raw_file.save(path, ContentFile(raw_content))
|
||||
email.save()
|
||||
|
||||
operations = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue