summaryrefslogtreecommitdiff
path: root/chimere/tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/tasks.py')
-rw-r--r--chimere/tasks.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/chimere/tasks.py b/chimere/tasks.py
index d457f6a..53c0e5b 100644
--- a/chimere/tasks.py
+++ b/chimere/tasks.py
@@ -87,14 +87,12 @@ def importing(importer_pk):
importer.state = unicode(IMPORT_MESSAGES['import_process'][0])
importer.save()
new_item, updated_item, error = importer.manager.get()
- if error:
- importer.state = unicode(IMPORT_MESSAGES['import_failed'][0]) \
- + u" - " + unicode(IMPORT_MESSAGES['import_failed'][1]) % error
- importer.save()
- return
- importer.state = unicode(IMPORT_MESSAGES['import_done'][0]) + u" - " \
+ importer.state = error + ' ' if error else ''
+ importer.state += unicode(IMPORT_MESSAGES['import_done'][0])
+ importer.state += u" - " \
+ unicode(IMPORT_MESSAGES['import_done'][1]) % {'new':new_item,
'updated':updated_item}
+ importer.state = importer.state[:200]
importer.save()
return True