mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-26 10:21:14 +00:00
Handle validation errors on reverse issue relations (#27695).
Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@17141 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
85ea5ed024
commit
ec53586af3
@ -46,7 +46,13 @@ class IssueRelationsController < ApplicationController
|
||||
@relation.issue_from = @issue
|
||||
@relation.safe_attributes = params[:relation]
|
||||
@relation.init_journals(User.current)
|
||||
saved = @relation.save
|
||||
|
||||
begin
|
||||
saved = @relation.save
|
||||
rescue ActiveRecord::RecordNotUnique
|
||||
saved = false
|
||||
@relation.errors.add :base, :taken
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to issue_path(@issue) }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user