From 74407183ac5e163096b3de6db7d7d4860800a52e Mon Sep 17 00:00:00 2001 From: j Date: Thu, 16 Feb 2017 18:31:09 +0100 Subject: [PATCH] fix migration --- pandora/document/migrations/0004_migrate_text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/document/migrations/0004_migrate_text.py b/pandora/document/migrations/0004_migrate_text.py index c03242a1..76a338e3 100644 --- a/pandora/document/migrations/0004_migrate_text.py +++ b/pandora/document/migrations/0004_migrate_text.py @@ -73,7 +73,7 @@ def migrate_texts(apps, schema_editor): d.data['text'] = t.text d.data['embeds'] = t.embeds d.save() - if t.type == 'pdf': + if t.type == 'pdf' and t.file: d.file.name = path(d, 'data.pdf') os.makedirs(os.path.dirname(d.file.path)) shutil.copy2(t.file.path, d.file.path)