| 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 3401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3412 tbd, comments = _get_draft_comments(request, issue) | 3412 tbd, comments = _get_draft_comments(request, issue) |
| 3413 else: | 3413 else: |
| 3414 tbd = [] | 3414 tbd = [] |
| 3415 comments = [] | 3415 comments = [] |
| 3416 issue.update_comment_count(len(comments)) | 3416 issue.update_comment_count(len(comments)) |
| 3417 tbd.append(issue) | 3417 tbd.append(issue) |
| 3418 | 3418 |
| 3419 if comments: | 3419 if comments: |
| 3420 logging.warn('Publishing %d comments', len(comments)) | 3420 logging.warn('Publishing %d comments', len(comments)) |
| 3421 | 3421 |
| 3422 email_to = None |
| 3423 auto_generated = False |
| 3422 if request.user.email().lower() in (CQ_COMMIT_BOT_EMAIL, CQ_SERVICE_ACCOUNT): | 3424 if request.user.email().lower() in (CQ_COMMIT_BOT_EMAIL, CQ_SERVICE_ACCOUNT): |
| 3423 issue.update_cq_status_url_if_any(form.cleaned_data['message']) | 3425 issue.update_cq_status_url_if_any(form.cleaned_data['message']) |
| 3424 | 3426 |
| 3425 # Email only the triggerer and the CL owner if it was a CQ dry run request. | 3427 if utils.is_cq_dry_run_message(form.cleaned_data['message']): |
| 3426 # More details are in http://crbug.com/476883. | 3428 # Mark CQ dry run messages as autogenerated. |
| 3427 email_to = None | 3429 # More details: http://crbug.com/596249. |
| 3428 # Mark CQ dry run messages as autogenerated. | 3430 auto_generated = True |
| 3429 # More details: http://crbug.com/596249. | 3431 # Email only the triggerer and the CL owner the dry run result, |
| 3430 auto_generated = False | 3432 # but don't email anyone on the first message. |
| 3431 if (request.user.email().lower() in (CQ_COMMIT_BOT_EMAIL, CQ_SERVICE_ACCOUNT) | 3433 # More details are in http://crbug.com/626427. |
| 3432 and 'dry run' in form.cleaned_data['message'].lower()): | 3434 if utils.is_cq_dry_run_start_message(form.cleaned_data['message']): |
| 3433 email_to = [issue.owner.email()] | 3435 email_to = [] |
| 3434 auto_generated = True | 3436 else: |
| 3435 if (issue.cq_dry_run_last_triggered_by and | 3437 email_to = list(set([issue.owner.email(), |
| 3436 issue.cq_dry_run_last_triggered_by != issue.owner.email()): | 3438 issue.cq_dry_run_last_triggered_by])) |
| 3437 email_to.append(issue.cq_dry_run_last_triggered_by) | 3439 |
| 3440 |
| 3438 msg = make_message(request, issue, | 3441 msg = make_message(request, issue, |
| 3439 form.cleaned_data['message'], | 3442 form.cleaned_data['message'], |
| 3440 comments, | 3443 comments, |
| 3441 form.cleaned_data['send_mail'], | 3444 form.cleaned_data['send_mail'], |
| 3442 draft=draft_message, | 3445 draft=draft_message, |
| 3443 email_to=email_to, | 3446 email_to=email_to, |
| 3444 in_reply_to=form.cleaned_data.get('in_reply_to'), | 3447 in_reply_to=form.cleaned_data.get('in_reply_to'), |
| 3445 auto_generated=auto_generated) | 3448 auto_generated=auto_generated) |
| 3446 tbd.append(msg) | 3449 tbd.append(msg) |
| 3447 | 3450 |
| (...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5576 return HttpResponseNotFound() | 5579 return HttpResponseNotFound() |
| 5577 tops = [] | 5580 tops = [] |
| 5578 shame = [] | 5581 shame = [] |
| 5579 for i in data: | 5582 for i in data: |
| 5580 if i.score == models.AccountStatsBase.NULL_SCORE: | 5583 if i.score == models.AccountStatsBase.NULL_SCORE: |
| 5581 shame.append(i) | 5584 shame.append(i) |
| 5582 else: | 5585 else: |
| 5583 tops.append(i) | 5586 tops.append(i) |
| 5584 return respond( | 5587 return respond( |
| 5585 request, 'leaderboard.html', {'tops': tops, 'shame': shame, 'when': when}) | 5588 request, 'leaderboard.html', {'tops': tops, 'shame': shame, 'when': when}) |
| OLD | NEW |