From 6fced18cd1724bf3c704678e4791536175fbce83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 12 Apr 2016 13:32:49 +0200 Subject: [PATCH] mail: use scanner category if there's no association yet --- welco/sources/mail/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/welco/sources/mail/models.py b/welco/sources/mail/models.py index 3b58da3..6d91fe9 100644 --- a/welco/sources/mail/models.py +++ b/welco/sources/mail/models.py @@ -99,6 +99,8 @@ class Mail(models.Model): for association in self.associations.all(): if association.formdef_category: categories[association.formdef_category] = True + if not categories and self.scanner_category: + categories[self.scanner_category] = True if not categories: return '-' return categories.keys()