From 4852d7b4cb2db54285f23ae80379bfd459056bc2 Mon Sep 17 00:00:00 2001 From: psiberx Date: Wed, 18 Sep 2024 21:27:09 +0300 Subject: [PATCH] Fix invalid foreign keys reporting --- src/App/Tweaks/Batch/TweakChangeset.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/App/Tweaks/Batch/TweakChangeset.cpp b/src/App/Tweaks/Batch/TweakChangeset.cpp index bc8c137..05421f6 100644 --- a/src/App/Tweaks/Batch/TweakChangeset.cpp +++ b/src/App/Tweaks/Batch/TweakChangeset.cpp @@ -447,14 +447,6 @@ void App::TweakChangeset::Commit(const Core::SharedPtr& aMa const auto& flatType = item.second.type; const auto& flatValue = item.second.value.get(); - const auto success = aManager->SetFlat(batch, flatId, flatType, flatValue); - - if (!success) - { - LogError("Can't assign flat {}.", aManager->GetName(flatId)); - continue; - } - if (aChangelog) { if (aManager->GetReflection()->IsForeignKey(flatType)) @@ -484,6 +476,14 @@ void App::TweakChangeset::Commit(const Core::SharedPtr& aMa } } } + + const auto success = aManager->SetFlat(batch, flatId, flatType, flatValue); + + if (!success) + { + LogError("Can't assign flat {}.", aManager->GetName(flatId)); + continue; + } } for (const auto& recordId : m_orderedRecords)