Index: dashboard/dashboard/pinpoint/handlers/gitiles.py |
diff --git a/dashboard/dashboard/pinpoint/handlers/gitiles.py b/dashboard/dashboard/pinpoint/handlers/gitiles.py |
index f4820d68ff664b9d0d20cfa7da2f0b8bf7875bf3..84ef1624a21d5ac1eba56e0796934162e5790d5a 100644 |
--- a/dashboard/dashboard/pinpoint/handlers/gitiles.py |
+++ b/dashboard/dashboard/pinpoint/handlers/gitiles.py |
@@ -5,12 +5,12 @@ |
import json |
import webapp2 |
-from dashboard.common import namespaced_stored_object |
+from dashboard.pinpoint.models.change import repository |
from dashboard.services import gitiles_service |
-_REPOSITORIES_KEY = 'repositories' |
- |
+# TODO: Remove this module. Cache commit git details in the Datastore and |
+# include them in Commit.AsDict(). |
class Gitiles(webapp2.RequestHandler): |
"""Handler that exposes gitiles service to UI.""" |
@@ -19,14 +19,13 @@ class Gitiles(webapp2.RequestHandler): |
git_hash_1 = self.request.get('git_hash', self.request.get('git_hash_1')) |
git_hash_2 = self.request.get('git_hash_2') |
- repositories = namespaced_stored_object.Get(_REPOSITORIES_KEY) |
- if repo not in repositories: |
+ try: |
+ repository_url = repository.RepositoryUrl(repo) |
+ except KeyError: |
self.response.out.write(json.dumps( |
{'error': 'Unknown repository: %s' % repo})) |
return |
- repository_url = repositories[repo]['repository_url'] |
- |
if not git_hash_1: |
self.response.out.write(json.dumps( |
{'error': "No 'git_hash' parameter specified."})) |