Commit bc013f51 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '118816-remove-translation-from-constant' into 'master'

Remove unnecessary translation from merge request model

Closes #118816

See merge request gitlab-org/gitlab!22952
parents d2d0871d 824f825e
......@@ -262,8 +262,6 @@ class MergeRequest < ApplicationRecord
RebaseLockTimeout = Class.new(StandardError)
REBASE_LOCK_MESSAGE = _("Failed to enqueue the rebase operation, possibly due to a long-lived transaction. Try again later.")
def self.reference_prefix
'!'
end
......@@ -1514,7 +1512,7 @@ class MergeRequest < ApplicationRecord
end
rescue ActiveRecord::LockWaitTimeout => e
Gitlab::ErrorTracking.track_exception(e)
raise RebaseLockTimeout, REBASE_LOCK_MESSAGE
raise RebaseLockTimeout, _('Failed to enqueue the rebase operation, possibly due to a long-lived transaction. Try again later.')
end
def source_project_variables
......
---
title: Fix rebase error message translation in merge requests
merge_request: 22952
author: briankabiro
type: fixed
......@@ -1412,7 +1412,7 @@ describe Projects::MergeRequestsController do
post_rebase
expect(response.status).to eq(409)
expect(json_response['merge_error']).to eq(MergeRequest::REBASE_LOCK_MESSAGE)
expect(json_response['merge_error']).to eq('Failed to enqueue the rebase operation, possibly due to a long-lived transaction. Try again later.')
end
end
......
......@@ -2260,7 +2260,7 @@ describe API::MergeRequests do
put api("/projects/#{project.id}/merge_requests/#{merge_request.iid}/rebase", user)
expect(response).to have_gitlab_http_status(409)
expect(json_response['message']).to eq(MergeRequest::REBASE_LOCK_MESSAGE)
expect(json_response['message']).to eq('Failed to enqueue the rebase operation, possibly due to a long-lived transaction. Try again later.')
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment