pull-request: fixed typo in wrong ref type error, and added which
refs are actually allowed.
This commit is contained in:
parent
e5360e80e4
commit
dabc592890
3 changed files with 5 additions and 5 deletions
|
|
@ -492,7 +492,7 @@ class PullrequestsController(BaseRepoController):
|
|||
msg = PullRequestModel.UPDATE_STATUS_MESSAGES[resp.reason]
|
||||
warning_reasons = [
|
||||
UpdateFailureReason.NO_CHANGE,
|
||||
UpdateFailureReason.WRONG_REF_TPYE,
|
||||
UpdateFailureReason.WRONG_REF_TYPE,
|
||||
]
|
||||
category = 'warning' if resp.reason in warning_reasons else 'error'
|
||||
h.flash(msg, category=category)
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class UpdateFailureReason(object):
|
|||
NO_CHANGE = 2
|
||||
|
||||
# The pull request has a reference type that is not supported for update.
|
||||
WRONG_REF_TPYE = 3
|
||||
WRONG_REF_TYPE = 3
|
||||
|
||||
# Update failed because the target reference is missing.
|
||||
MISSING_TARGET_REF = 4
|
||||
|
|
|
|||
|
|
@ -118,9 +118,9 @@ class PullRequestModel(BaseModel):
|
|||
'Pull request update failed because of an unknown error.'),
|
||||
UpdateFailureReason.NO_CHANGE: lazy_ugettext(
|
||||
'No update needed because the source and target have not changed.'),
|
||||
UpdateFailureReason.WRONG_REF_TPYE: lazy_ugettext(
|
||||
UpdateFailureReason.WRONG_REF_TYPE: lazy_ugettext(
|
||||
'Pull request cannot be updated because the reference type is '
|
||||
'not supported for an update.'),
|
||||
'not supported for an update. Only Branch, Tag or Bookmark is allowed.'),
|
||||
UpdateFailureReason.MISSING_TARGET_REF: lazy_ugettext(
|
||||
'This pull request cannot be updated because the target '
|
||||
'reference is missing.'),
|
||||
|
|
@ -594,7 +594,7 @@ class PullRequestModel(BaseModel):
|
|||
pull_request, source_ref_type)
|
||||
return UpdateResponse(
|
||||
executed=False,
|
||||
reason=UpdateFailureReason.WRONG_REF_TPYE,
|
||||
reason=UpdateFailureReason.WRONG_REF_TYPE,
|
||||
old=pull_request, new=None, changes=None,
|
||||
source_changed=False, target_changed=False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue