Use a readonly transaction to load module without update

Closes #12542
This commit is contained in:
Cédric Krier committed 2024-05-23 14:18:51 +02:00
1 parent bf70e12f8f
commit f0f2294d2c
1 file changed
+2 -2
+2 -2
View File
@@ -384,10 +384,10 @@ def load_modules(
Module.update_list()
if not Transaction().connection:
with Transaction().start(database_name, 0):
with Transaction().start(database_name, 0, readonly=not update):
_load_modules(update)
else:
with Transaction().new_transaction(), \
with Transaction().new_transaction(readonly=not update), \
Transaction().set_user(0), \
Transaction().reset_context():
_load_modules(update)