| OLD | NEW |
| 1 # Copyright 2008 Google Inc. | 1 # Copyright 2008 Google Inc. |
| 2 # | 2 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); | 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 # you may not use this file except in compliance with the License. | 4 # you may not use this file except in compliance with the License. |
| 5 # You may obtain a copy of the License at | 5 # You may obtain a copy of the License at |
| 6 # | 6 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 | 7 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # | 8 # |
| 9 # Unless required by applicable law or agreed to in writing, software | 9 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, | 10 # distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 from oauth2client.appengine import _safe_html | 71 from oauth2client.appengine import _safe_html |
| 72 from oauth2client.appengine import CredentialsNDBModel | 72 from oauth2client.appengine import CredentialsNDBModel |
| 73 from oauth2client.appengine import StorageByKeyName | 73 from oauth2client.appengine import StorageByKeyName |
| 74 from oauth2client.appengine import xsrf_secret_key | 74 from oauth2client.appengine import xsrf_secret_key |
| 75 from oauth2client.client import AccessTokenRefreshError | 75 from oauth2client.client import AccessTokenRefreshError |
| 76 from oauth2client.client import OAuth2WebServerFlow | 76 from oauth2client.client import OAuth2WebServerFlow |
| 77 from oauth2client import xsrfutil | 77 from oauth2client import xsrfutil |
| 78 | 78 |
| 79 from codereview import auth_utils | 79 from codereview import auth_utils |
| 80 from codereview import buildbucket | 80 from codereview import buildbucket |
| 81 from codereview import common |
| 81 from codereview import engine | 82 from codereview import engine |
| 82 from codereview import library | 83 from codereview import library |
| 83 from codereview import models | 84 from codereview import models |
| 84 from codereview import models_chromium | 85 from codereview import models_chromium |
| 85 from codereview import notify_xmpp | 86 from codereview import notify_xmpp |
| 86 from codereview import patching | 87 from codereview import patching |
| 87 from codereview import utils | 88 from codereview import utils |
| 88 from codereview.common import IS_DEV | 89 from codereview.common import IS_DEV |
| 89 from codereview.exceptions import FetchError | 90 from codereview.exceptions import FetchError |
| 90 from codereview.responses import HttpTextResponse, HttpHtmlResponse, respond | 91 from codereview.responses import HttpTextResponse, HttpHtmlResponse, respond |
| (...skipping 4051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4142 issue.reviewers.append(sender) | 4143 issue.reviewers.append(sender) |
| 4143 | 4144 |
| 4144 issue.calculate_updates_for(msg) | 4145 issue.calculate_updates_for(msg) |
| 4145 issue.put() | 4146 issue.put() |
| 4146 msg.put() | 4147 msg.put() |
| 4147 | 4148 |
| 4148 | 4149 |
| 4149 def _absolute_url_in_preferred_domain(handler, args=None): | 4150 def _absolute_url_in_preferred_domain(handler, args=None): |
| 4150 """Return a URL for handler via our preferred domain name, if possible.""" | 4151 """Return a URL for handler via our preferred domain name, if possible.""" |
| 4151 handler_url_path = reverse(handler, args=args) | 4152 handler_url_path = reverse(handler, args=args) |
| 4152 app_id = app_identity.get_application_id() | 4153 host = common.get_preferred_domain_name() |
| 4153 canonical_host = '%s.appspot.com' % app_id | |
| 4154 host = django_settings.PREFERRED_DOMAIN_NAMES.get(app_id, canonical_host) | |
| 4155 return 'https://%s%s' % (host, handler_url_path) | 4154 return 'https://%s%s' % (host, handler_url_path) |
| 4156 | 4155 |
| 4157 | 4156 |
| 4158 LGTM_REMINDER_BODY = """ | 4157 LGTM_REMINDER_BODY = """ |
| 4159 REMINDER: If this change looks good, please use the LGTM button at | 4158 REMINDER: If this change looks good, please use the LGTM button at |
| 4160 %s | 4159 %s |
| 4161 """ | 4160 """ |
| 4162 | 4161 |
| 4163 def _send_lgtm_reminder(addr, subject, publish_url): | 4162 def _send_lgtm_reminder(addr, subject, publish_url): |
| 4164 """Remind a user to LGTM through the web UI, not email.""" | 4163 """Remind a user to LGTM through the web UI, not email.""" |
| (...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5397 return HttpResponseNotFound() | 5396 return HttpResponseNotFound() |
| 5398 tops = [] | 5397 tops = [] |
| 5399 shame = [] | 5398 shame = [] |
| 5400 for i in data: | 5399 for i in data: |
| 5401 if i.score == models.AccountStatsBase.NULL_SCORE: | 5400 if i.score == models.AccountStatsBase.NULL_SCORE: |
| 5402 shame.append(i) | 5401 shame.append(i) |
| 5403 else: | 5402 else: |
| 5404 tops.append(i) | 5403 tops.append(i) |
| 5405 return respond( | 5404 return respond( |
| 5406 request, 'leaderboard.html', {'tops': tops, 'shame': shame, 'when': when}) | 5405 request, 'leaderboard.html', {'tops': tops, 'shame': shame, 'when': when}) |
| OLD | NEW |