Skip to content

Commit

Permalink
Fix invalid foreign keys reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
psiberx committed Sep 18, 2024
1 parent 419bc64 commit 4852d7b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/App/Tweaks/Batch/TweakChangeset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,6 @@ void App::TweakChangeset::Commit(const Core::SharedPtr<Red::TweakDBManager>& 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))
Expand Down Expand Up @@ -484,6 +476,14 @@ void App::TweakChangeset::Commit(const Core::SharedPtr<Red::TweakDBManager>& 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)
Expand Down

0 comments on commit 4852d7b

Please sign in to comment.