transaction: Add durable=True to outermost transaction.atomic decorator.

This commit adds 'durable=True' to the outermost transactions
of the following functions:
* do_create_multiuse_invite_link
* do_revoke_user_invite
* do_revoke_multi_use_invite
* sync_ldap_user_data
* do_reactivate_remote_server
* do_deactivate_remote_server
* bulk_handle_digest_email
* handle_customer_migration_from_server_to_realm
* add_reaction
* remove_reaction
* deactivate_user_group

It helps to avoid creating unintended savepoints in the future.

This is as a part of our plan to explicitly mark all the
transaction.atomic decorators with either 'savepoint=False' or
'durable=True' as required.

* 'savepoint=True' is used in special cases.
This commit is contained in:
Prakhar Pratyush
2024-11-01 16:42:53 +05:30
committed by Tim Abbott
parent 9371bdb81d
commit 0fb5657131
7 changed files with 11 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ log_to_file(logger, settings.LDAP_SYNC_LOG_PATH)
# Run this on a cron job to pick up on name changes.
@transaction.atomic
@transaction.atomic(durable=True)
def sync_ldap_user_data(
user_profiles: QuerySet[UserProfile], deactivation_protection: bool = True
) -> None: