##// END OF EJS Templates
api: add send_email flag for comments api to allow commenting without email notification....
bart -
r4196:bb0e450f stable
parent child Browse files
Show More
@@ -56,5 +56,6 b' class TestGetMethod(object):'
56 56 'request': '<RequiredType>',
57 57 'resolves_comment_id': '<Optional:None>',
58 58 'status': '<Optional:None>',
59 'userid': '<Optional:<OptionalAttr:apiuser>>'}]
59 'userid': '<Optional:<OptionalAttr:apiuser>>',
60 'send_email': '<Optional:True>'}]
60 61 assert_ok(id_, expected, given=response.body)
@@ -452,7 +452,7 b' def comment_pull_request('
452 452 message=Optional(None), commit_id=Optional(None), status=Optional(None),
453 453 comment_type=Optional(ChangesetComment.COMMENT_TYPE_NOTE),
454 454 resolves_comment_id=Optional(None), extra_recipients=Optional([]),
455 userid=Optional(OAttr('apiuser'))):
455 userid=Optional(OAttr('apiuser')), send_email=Optional(True)):
456 456 """
457 457 Comment on the pull request specified with the `pullrequestid`,
458 458 in the |repo| specified by the `repoid`, and optionally change the
@@ -483,6 +483,8 b' def comment_pull_request('
483 483 :type extra_recipients: Optional(list)
484 484 :param userid: Comment on the pull request as this user
485 485 :type userid: Optional(str or int)
486 :param send_email: Define if this comment should also send email notification
487 :type send_email: Optional(bool)
486 488
487 489 Example output:
488 490
@@ -527,6 +529,7 b' def comment_pull_request('
527 529 comment_type = Optional.extract(comment_type)
528 530 resolves_comment_id = Optional.extract(resolves_comment_id)
529 531 extra_recipients = Optional.extract(extra_recipients)
532 send_email = Optional.extract(send_email, binary=True)
530 533
531 534 if not message and not status:
532 535 raise JSONRPCError(
@@ -587,7 +590,8 b' def comment_pull_request('
587 590 comment_type=comment_type,
588 591 resolves_comment_id=resolves_comment_id,
589 592 auth_user=auth_user,
590 extra_recipients=extra_recipients
593 extra_recipients=extra_recipients,
594 send_email=send_email
591 595 )
592 596
593 597 if allowed_to_change_status and status:
@@ -1551,7 +1551,7 b' def comment_commit('
1551 1551 request, apiuser, repoid, commit_id, message, status=Optional(None),
1552 1552 comment_type=Optional(ChangesetComment.COMMENT_TYPE_NOTE),
1553 1553 resolves_comment_id=Optional(None), extra_recipients=Optional([]),
1554 userid=Optional(OAttr('apiuser'))):
1554 userid=Optional(OAttr('apiuser')), send_email=Optional(True)):
1555 1555 """
1556 1556 Set a commit comment, and optionally change the status of the commit.
1557 1557
@@ -1575,6 +1575,8 b' def comment_commit('
1575 1575 :type extra_recipients: Optional(list)
1576 1576 :param userid: Set the user name of the comment creator.
1577 1577 :type userid: Optional(str or int)
1578 :param send_email: Define if this comment should also send email notification
1579 :type send_email: Optional(bool)
1578 1580
1579 1581 Example error output:
1580 1582
@@ -1610,6 +1612,7 b' def comment_commit('
1610 1612 comment_type = Optional.extract(comment_type)
1611 1613 resolves_comment_id = Optional.extract(resolves_comment_id)
1612 1614 extra_recipients = Optional.extract(extra_recipients)
1615 send_email = Optional.extract(send_email, binary=True)
1613 1616
1614 1617 allowed_statuses = [x[0] for x in ChangesetStatus.STATUSES]
1615 1618 if status and status not in allowed_statuses:
@@ -1639,7 +1642,8 b' def comment_commit('
1639 1642 comment_type=comment_type,
1640 1643 resolves_comment_id=resolves_comment_id,
1641 1644 auth_user=apiuser,
1642 extra_recipients=extra_recipients
1645 extra_recipients=extra_recipients,
1646 send_email=send_email
1643 1647 )
1644 1648 if status:
1645 1649 # also do a status change
General Comments 0
You need to be logged in to leave comments. Login now