From 9da920d80dfcad81df060ec1e9f52a500f281b3a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 2 Jun 2015 00:16:39 +0200 Subject: Remove error file when no error is reported on re-import --- ishtar_common/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 1db35741d..09740436c 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1382,7 +1382,7 @@ class Import(models.Model): actions.append(('A', _(u"Re-analyse"))) actions.append(('I', _(u"Re-import"))) actions.append(('AC', _(u"Archive"))) - if self.state in ('AC'): + if self.state == 'AC': actions.append(('A', _(u"Unarchive"))) actions.append(('D', _(u"Delete"))) return actions @@ -1446,6 +1446,7 @@ class Import(models.Model): self.error_file = File(open(fle.name)) else: self.state = 'F' + self.error_file = None self.save() def archive(self): -- cgit v1.2.3