bodhi/model.py | 4 +++-
bodhi/templates/welcome.kid | 5 -----
bodhi/tests/test_model.py | 11 +++++++++++
3 files changed, 14 insertions(+), 6 deletions(-)
New commits:
commit ff2fa4f45b980f0ccbabb0dd40b213f25468f374
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 11 17:00:57 2009 -0400
Fix a bug that would cause duplicate update IDs across Fedora 10/11 (#515853)
This bug was introduced along with EPEL support, and causes updates for
releases that share the same Release.id_prefix to be assigned duplicate
update IDs.
This patch also contains a unit test for this problem.
diff --git a/bodhi/model.py b/bodhi/model.py
index 0806beb..1caaa8b 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -298,10 +298,12 @@ class PackageUpdate(SQLObject):
log.debug("Keeping current update id %s" % self.updateid)
return
+ releases = Release.select(Release.q.id_prefix == self.release.id_prefix)
updates = PackageUpdate.select(
AND(PackageUpdate.q.date_pushed != None,
PackageUpdate.q.updateid != None,
- PackageUpdate.q.releaseID == self.release.id),
+ OR(*[PackageUpdate.q.releaseID == rel.id
+ for rel in releases])),
orderBy=PackageUpdate.q.date_pushed, limit=1).reversed()
try:
diff --git a/bodhi/tests/test_model.py b/bodhi/tests/test_model.py
index 8e342f3..1affb95 100644
--- a/bodhi/tests/test_model.py
+++ b/bodhi/tests/test_model.py
@@ -115,6 +115,17 @@ class TestPackageUpdate(testutil.DBTest):
assert update.updateid == '%s-%s-0002' % (update.release.id_prefix,
time.localtime()[0])
+ # Create another update for another release that has the same
+ # Release.id_prefix. This used to trigger a bug that would cause
+ # duplicate IDs across Fedora 10/11 updates.
+ update = self.get_update(name='nethack-3.4.5-1.fc7')
+ otherrel = Release(name='fc11', long_name='Fedora 11',
+ id_prefix='FEDORA', dist_tag='dist-fc11')
+ update.release = otherrel
+ update.assign_id()
+ assert update.updateid == '%s-%s-0003' % (update.release.id_prefix,
+ time.localtime()[0])
+
# 10k bug
update.updateid = 'FEDORA-2009-9999'
newupdate = self.get_update(name='nethack-2.5.6-1.fc10')
commit f40a28a7de655c643dd4ed2c8a2af91e426610dc
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 11 16:51:27 2009 -0400
Actually remove the mugshot link this time
diff --git a/bodhi/templates/welcome.kid b/bodhi/templates/welcome.kid
index 4e488ef..62c602a 100644
--- a/bodhi/templates/welcome.kid
+++ b/bodhi/templates/welcome.kid
@@ -56,11 +56,6 @@
<a
href="http://koji.fedoraproject.org/koji/" class="list"><font
size="6">้บน</font></a>
</span>
</td>
- <td>
- <span id="mugtip" title="Fedora
Infrastructure Mugshot Group">
- <a
href="http://mugshot.org/group?who=yWstkV2xGz93rQ"><img
src="${tg.url('/static/images/mugshot.png')}" border="0"
/></a>
- </span>
- </td>
</tr>
</table>
</td>