From c35ab145a44218a32884321cd881731b274c09fb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 09:36:53 +1100 Subject: [PATCH] Prevent exchange rate update during migration (#11429) (#11430) (cherry picked from commit fb3b1189fd2c298f3812abbee79e7ebf63acedaa) Co-authored-by: Oliver --- src/backend/InvenTree/InvenTree/tasks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/InvenTree/InvenTree/tasks.py b/src/backend/InvenTree/InvenTree/tasks.py index f5b207e805..887c11899d 100644 --- a/src/backend/InvenTree/InvenTree/tasks.py +++ b/src/backend/InvenTree/InvenTree/tasks.py @@ -587,7 +587,10 @@ def update_exchange_rates(force: bool = False): Arguments: force: If True, force the update to run regardless of the last update time """ - from InvenTree.ready import canAppAccessDatabase + from InvenTree.ready import canAppAccessDatabase, isRunningMigrations + + if isRunningMigrations(): + return # Do not update exchange rates if we cannot access the database if not canAppAccessDatabase(allow_test=True, allow_shell=True):