diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-11-06 00:15:38 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2021-11-06 00:15:38 +0100 |
commit | 4bb6b1a1e788abac7d1745e0f4eb72ad4d4ec110 (patch) | |
tree | a329d65c115e752c3be5c262ebf96f69cd13861a /app/workers | |
parent | e0f39626973fd9f5cce2d4cd3b166fb47e9c9059 (diff) | |
parent | 6da135a493cc039d92bb5925c2a1ef66025623bf (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/move_worker.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/workers/move_worker.rb b/app/workers/move_worker.rb index cc2c17d32..4a900e3b8 100644 --- a/app/workers/move_worker.rb +++ b/app/workers/move_worker.rb @@ -53,10 +53,16 @@ class MoveWorker new_note = AccountNote.find_by(account: note.account, target_account: @target_account) if new_note.nil? - AccountNote.create!(account: note.account, target_account: @target_account, comment: [text, note.comment].join("\n")) + begin + AccountNote.create!(account: note.account, target_account: @target_account, comment: [text, note.comment].join("\n")) + rescue ActiveRecord::RecordInvalid + AccountNote.create!(account: note.account, target_account: @target_account, comment: note.comment) + end else new_note.update!(comment: [text, note.comment, "\n", new_note.comment].join("\n")) end + rescue ActiveRecord::RecordInvalid + nil rescue => e @deferred_error = e end |