mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 04:27:45 +00:00
MariaDB foibles, try to work around them
This commit is contained in:
@@ -12,6 +12,7 @@ from pathlib import Path
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import connection
|
||||
from django.db import transaction
|
||||
|
||||
import troggle.settings as settings
|
||||
from troggle.core.models.caves import Cave, Entrance, GetCaveLookup
|
||||
@@ -2334,8 +2335,12 @@ class LoadingSurvex:
|
||||
qms_csv = QM.objects.filter(loaded_from_csv=True) # the CSV QMs
|
||||
print(f"\n - Currently {len(qms_svx)} survex QMs and {len(qms_csv)} CSV QMs", file=sys.stderr)
|
||||
|
||||
# Getting round MariaDB foibles: put these in different transactions
|
||||
with transaction.atomic():
|
||||
self.save_survexblocks_to_db()
|
||||
with transaction.atomic():
|
||||
self.save_personroles_to_db()
|
||||
with transaction.atomic():
|
||||
self.save_qms_to_db()
|
||||
qms_n = QM.objects.all().count()
|
||||
print(f" - Now {qms_n} QMs in total", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user