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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
448 form = EditFlagsForm(request.POST) | 448 form = EditFlagsForm(request.POST) |
449 if not form.is_valid(): | 449 if not form.is_valid(): |
450 return HttpResponseBadRequest('Invalid POST arguments', | 450 return HttpResponseBadRequest('Invalid POST arguments', |
451 content_type='text/plain') | 451 content_type='text/plain') |
452 if (form.cleaned_data['last_patchset'] != last_patchset.key().id()): | 452 if (form.cleaned_data['last_patchset'] != last_patchset.key().id()): |
453 return HttpResponseForbidden('Can only modify flags on last patchset', | 453 return HttpResponseForbidden('Can only modify flags on last patchset', |
454 content_type='text/plain') | 454 content_type='text/plain') |
455 | 455 |
456 if 'commit' in request.POST: | 456 if 'commit' in request.POST: |
457 request.issue.commit = form.cleaned_data['commit'] | 457 request.issue.commit = form.cleaned_data['commit'] |
458 if request.user.email() not in request.issue.reviewers: | 458 user_email = request.user.email().lower() |
iannucci
2013/05/24 22:12:45
why the .lower()?
Mike Stip (use stip instead)
2013/05/24 22:26:31
to better match the logic in lines 695-701 of view
| |
459 if (user_email != request.issue.owner.email() and | |
460 user_email not in request.issue.reviewers and | |
461 user_email not in request.issue.cc and | |
iannucci
2013/05/24 22:12:45
Actually we want ppl to get promoted from CC to re
Mike Stip (use stip instead)
2013/05/24 22:26:31
Done.
| |
462 user_email not in request.issue.collaborator_emails()): | |
459 request.issue.reviewers.append(db.Email(request.user.email())) | 463 request.issue.reviewers.append(db.Email(request.user.email())) |
460 request.issue.put() | 464 request.issue.put() |
461 | 465 |
462 if 'builders' in request.POST: | 466 if 'builders' in request.POST: |
463 def txn(): | 467 def txn(): |
464 jobs_to_save = [] | 468 jobs_to_save = [] |
465 new_builders = filter(None, map(unicode.strip, | 469 new_builders = filter(None, map(unicode.strip, |
466 form.cleaned_data['builders'].split(','))) | 470 form.cleaned_data['builders'].split(','))) |
467 | 471 |
468 # Add any new builders. | 472 # Add any new builders. |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
846 q = models.TryJobResult.all().filter( | 850 q = models.TryJobResult.all().filter( |
847 'result =', models.TryJobResult.TRYPENDING).order('timestamp') | 851 'result =', models.TryJobResult.TRYPENDING).order('timestamp') |
848 if cursor: | 852 if cursor: |
849 q.with_cursor(cursor) | 853 q.with_cursor(cursor) |
850 | 854 |
851 jobs = q.fetch(limit) | 855 jobs = q.fetch(limit) |
852 total = len(jobs) | 856 total = len(jobs) |
853 jobs = [MakeJobDescription(job) for job in jobs if _is_job_valid(job)] | 857 jobs = [MakeJobDescription(job) for job in jobs if _is_job_valid(job)] |
854 logging.info('Found %d entries, returned %d' % (total, len(jobs))) | 858 logging.info('Found %d entries, returned %d' % (total, len(jobs))) |
855 return {'cursor': q.cursor(), 'jobs': jobs} | 859 return {'cursor': q.cursor(), 'jobs': jobs} |
OLD | NEW |