From eae411941b908b69e46b7dac27ece00409578001 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 20 Oct 2022 08:57:14 +0200 Subject: [PATCH] Don't crash on delete requests --- lib/request.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/request.py b/lib/request.py index afc24bf..33c62c1 100644 --- a/lib/request.py +++ b/lib/request.py @@ -3,9 +3,13 @@ class Request: self.number = int(xml.get("id")) self.creator = xml.get("creator") self.state = xml.find("state").get("name") + self.target = xml.find("action/target").get("project") self.type_ = xml.find("action").get("type") if self.type_ == "delete": + self.source_package = None + self.source_project = None + self.source_rev = None # not much to do return self @@ -15,8 +19,6 @@ class Request: # expanded MD5 or commit revision self.source_rev = xml.find("action/source").get("rev") - self.target = xml.find("action/target").get("project") - # TODO: support muti-action requests # TODO: parse review history # TODO: add description