no ModelLog creation for step1 of migration

sync
Laurent 8 months ago
parent 9c95e0d4c9
commit 6c69dcb392
  1. 26
      sync/signals.py

@ -124,19 +124,19 @@ def save_model_log(users, model_operation, model_name, model_id, store_id):
device_id = device_registry.get_device_id(model_id)
with transaction.atomic():
for user in users:
print(f'>>> create log for {user.username} : {model_operation} {model_name}')
# if user.should_synchronize:
model_log = ModelLog()
model_log.user = user
model_log.operation = model_operation
model_log.model_name = model_name
model_log.model_id = model_id
model_log.store_id = store_id
model_log.device_id = device_id
model_log.save()
# with transaction.atomic():
# for user in users:
# print(f'>>> create log for {user.username} : {model_operation} {model_name}')
# # if user.should_synchronize:
# model_log = ModelLog()
# model_log.user = user
# model_log.operation = model_operation
# model_log.model_name = model_name
# model_log.model_id = model_id
# model_log.store_id = store_id
# model_log.device_id = device_id
# model_log.save()
# print(f'ML users = {len(users)}')
# existing_log = ModelLog.objects.filter(users__in=users, model_id=model_id, operation=model_operation).first()

Loading…
Cancel
Save