]> source.dussan.org Git - redmine.git/commitdiff
Fix detach attachments when a conflict occurs (#29914, #32923).
authorGo MAEDA <maeda@farend.jp>
Thu, 1 Apr 2021 15:25:40 +0000 (15:25 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 1 Apr 2021 15:25:40 +0000 (15:25 +0000)
Patch by Pavel Rosický.

git-svn-id: http://svn.redmine.org/redmine/trunk@20894 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb

index f45d9bf06669570ad85ce34806856c0e59ee4ecb..c994862e1b8633719c13a9a1a466e70682435394 100644 (file)
@@ -189,6 +189,7 @@ class IssuesController < ApplicationController
     begin
       saved = save_issue_with_child_records
     rescue ActiveRecord::StaleObjectError
+      @issue.detach_saved_attachments
       @conflict = true
       if params[:last_journal_id]
         @conflict_journals = @issue.journals_after(params[:last_journal_id]).to_a