From f1ccef1599d3257912ce7e4160d2df28a4240e97 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Tue, 17 Dec 2019 09:53:59 -0800 Subject: [PATCH] Autopopulate source name tag on imports --- inquisitor/importer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inquisitor/importer.py b/inquisitor/importer.py index fcc7a94..60d7efe 100644 --- a/inquisitor/importer.py +++ b/inquisitor/importer.py @@ -112,7 +112,9 @@ def populate_new(item): if 'time' not in item: item['time'] = None if 'author' not in item: item['author'] = None if 'body' not in item: item['body'] = None - if 'tags' not in item: item['tags'] = [item['source']] + tags = item['tags'] if 'tags' in item else [] + if item['source'] not in tags: tags.insert(0, item['source']) + item['tags'] = tags if 'ttl' not in item: item['ttl'] = 0 def populate_old(prior, new):