##// END OF EJS Templates
pull-request: lock button when updating reviewers to forbid multi-submit....
marcink -
r1578:3793854d default
parent child Browse files
Show More
@@ -886,20 +886,22 b' class PullRequestModel(BaseModel):'
886 886 reviewer = PullRequestReviewers(_usr, pull_request, reasons)
887 887 Session().add(reviewer)
888 888
889 self.notify_reviewers(pull_request, ids_to_add)
890
891 889 for uid in ids_to_remove:
892 890 changed = True
893 reviewer = PullRequestReviewers.query()\
891 reviewers = PullRequestReviewers.query()\
894 892 .filter(PullRequestReviewers.user_id == uid,
895 893 PullRequestReviewers.pull_request == pull_request)\
896 .scalar()
897 if reviewer:
898 Session().delete(reviewer)
894 .all()
895 # use .all() in case we accidentally added the same person twice
896 # this CAN happen due to the lack of DB checks
897 for obj in reviewers:
898 Session().delete(obj)
899
899 900 if changed:
900 901 pull_request.updated_on = datetime.datetime.now()
901 902 Session().add(pull_request)
902 903
904 self.notify_reviewers(pull_request, ids_to_add)
903 905 return ids_to_add, ids_to_remove
904 906
905 907 def get_url(self, pull_request):
@@ -1329,13 +1329,6 b' table.integrations {'
1329 1329 .reviewer {
1330 1330 float: left;
1331 1331 }
1332
1333 &.to-delete {
1334 .user,
1335 .reviewer {
1336 text-decoration: line-through;
1337 }
1338 }
1339 1332 }
1340 1333
1341 1334 .reviewer_member_remove {
@@ -28,11 +28,12 b' var removeReviewMember = function(review'
28 28
29 29 if(mark_delete === true){
30 30 if (reviewer){
31 // mark as to-remove
31 // now delete the input
32 $('#reviewer_{0} input'.format(reviewer_id)).remove();
33 // mark as to-delete
32 34 var obj = $('#reviewer_{0}_name'.format(reviewer_id));
33 35 obj.addClass('to-delete');
34 // now delete the input
35 $('#reviewer_{0} input'.format(reviewer_id)).remove();
36 obj.css({"text-decoration":"line-through", "opacity": 0.5});
36 37 }
37 38 }
38 39 else{
@@ -362,7 +362,7 b''
362 362 <div id="reviewers_container"></div>
363 363 </div>
364 364 <div>
365 <span id="update_pull_request" class="btn btn-small">${_('Save Changes')}</span>
365 <button id="update_pull_request" class="btn btn-small">${_('Save Changes')}</button>
366 366 </div>
367 367 %endif
368 368 </div>
@@ -766,6 +766,9 b''
766 766 });
767 767
768 768 $('#update_pull_request').on('click', function(e){
769 $(this).attr('disabled', 'disabled');
770 $(this).addClass('disabled');
771 $(this).html(_gettext('saving...'));
769 772 updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}");
770 773 });
771 774
General Comments 0
You need to be logged in to leave comments. Login now