Commit 3b938f7d authored by Andrew Gerrand's avatar Andrew Gerrand

dashboard: bug fix

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4535104
parent 4c2123e5
...@@ -376,8 +376,8 @@ def getBrokenCommit(node, builder): ...@@ -376,8 +376,8 @@ def getBrokenCommit(node, builder):
return return
def firstResult(builder): def firstResult(builder):
q = Commit.all().order('-__key__').limit(20) q = Commit.all().order('-__key__')
for c in q: for c in q.fetch(20):
for i, b in enumerate(c.builds): for i, b in enumerate(c.builds):
p = b.split('`', 1) p = b.split('`', 1)
if p[0] == builder: if p[0] == builder:
...@@ -392,9 +392,12 @@ def nodeAfter(c): ...@@ -392,9 +392,12 @@ def nodeAfter(c):
def notifyBroken(c, builder): def notifyBroken(c, builder):
def send(): def send():
n = Commit.get_by_key_name('%08x-%s' % (c.num, c.node)) n = Commit.get(c.key())
if n.fail_notification_sent: if n is None:
return False logging.error("couldn't retrieve Commit '%s'" % c.key())
return False
if n.fail_notification_sent:
return False
n.fail_notification_sent = True n.fail_notification_sent = True
return n.put() return n.put()
if not db.run_in_transaction(send): if not db.run_in_transaction(send):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment