bodhi/model.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
New commits:
commit 1d2bbaa867257fa134def9525fd0a629a6316fdb
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Sep 6 16:34:18 2011 -0400
If an obsolete build is being re-submitted, return it to the pending state, and make
sure it's tagged as a candidate
diff --git a/bodhi/model.py b/bodhi/model.py
index 7f9a4c0..30774b9 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -537,6 +537,13 @@ class PackageUpdate(SQLObject):
elif action == 'stable':
self.add_tag(self.release.pending_stable_tag)
+ # If an obsolete build is being re-submitted, return
+ # it to the pending state, and make sure it's tagged as a candidate
+ if self.status == 'obsolete':
+ self.status = 'pending'
+ if not self.release.candidate_tag in self.get_tags():
+ self.add_tag(self.release.candidate_tag)
+
self.request = action
self.pushed = False
#self.date_pushed = None
commit d922871874961a03f1467cfa81af52b4a1474f1f
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Sep 6 16:34:06 2011 -0400
Add a PackageUpdate.get_tags helper method
diff --git a/bodhi/model.py b/bodhi/model.py
index 1535630..7f9a4c0 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1212,6 +1212,17 @@ class PackageUpdate(SQLObject):
except SQLObjectNotFound:
pass
+ def get_tags(self):
+ """
+ Return a list of all of the tags that all of the builds in this update
+ are tagged with
+ """
+ tags = set()
+ for build in self.builds:
+ for tag in build.get_tags():
+ tag.add(tags)
+ return list(tags)
+
class Comment(SQLObject):
timestamp = DateTimeCol(default=datetime.utcnow)
Show replies by date