| Index: dashboard/dashboard/graph_revisions.py
|
| diff --git a/dashboard/dashboard/graph_revisions.py b/dashboard/dashboard/graph_revisions.py
|
| index 0aee43ef0dffac05b765d3590a26b2b616f4b8ca..1486a24e0ae7551b88826694649acbdbdd5e16f5 100644
|
| --- a/dashboard/dashboard/graph_revisions.py
|
| +++ b/dashboard/dashboard/graph_revisions.py
|
| @@ -78,10 +78,11 @@ def _UpdateCache(test_key):
|
| Returns:
|
| The list of triplets that was just fetched and set in the cache.
|
| """
|
| - if not test_key.get():
|
| - # The caching can actually proceed even if the Test entity doesn't exist,
|
| - # but a non-existent Test entity definitely indicates something is wrong.
|
| - logging.warn('Test not found: %s', utils.TestPath(test_key))
|
| + test = test_key.get()
|
| + if not test:
|
| + return []
|
| + assert(utils.IsInternalUser() or not test.internal_only)
|
| + datastore_hooks.SetSinglePrivilegedRequest()
|
|
|
| # A projection query queries just for the values of particular properties;
|
| # this is faster than querying for whole entities.
|
| @@ -90,6 +91,9 @@ def _UpdateCache(test_key):
|
|
|
| # Using a large batch_size speeds up queries with > 1000 Rows.
|
| rows = map(_MakeTriplet, query.iter(batch_size=1000))
|
| + # Note: Unit tests do not call datastore_hooks with the above query, but
|
| + # it is called in production and with more recent SDK.
|
| + datastore_hooks.CancelSinglePrivilegedRequest()
|
| SetCache(utils.TestPath(test_key), rows)
|
| return rows
|
|
|
|
|