From 5c7300caf090b00ddc2eec18055dbc7e799c2f62 Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Tue, 14 Jan 2020 23:24:08 +0000 Subject: [PATCH] Excuse: get source from MigrationItem --- britney2/excuse.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/britney2/excuse.py b/britney2/excuse.py index ff8551d..bb076cf 100644 --- a/britney2/excuse.py +++ b/britney2/excuse.py @@ -195,6 +195,10 @@ class Excuse(object): def name(self): return self.item.name + @property + def source(self): + return self.item.package + @property def is_valid(self): return False if self._policy_verdict.is_rejected else True @@ -433,17 +437,10 @@ class Excuse(object): def excusedata(self): """Render the excuse in as key-value data""" - source = self.name - if '_' in source: - source = source.split("_")[0] - if '/' in source: - source = source.split("/")[0] - if source[0] == '-': - source = source[1:] excusedata = {} excusedata["excuses"] = self._text() excusedata["item-name"] = self.name - excusedata["source"] = source + excusedata["source"] = self.source excusedata["migration-policy-verdict"] = self._policy_verdict.name excusedata["old-version"] = self.ver[0] excusedata["new-version"] = self.ver[1]