mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-11 15:22:55 +02:00
Merge pull request #376
fix(rules:dry-run): current_user getting overwritten and delete on synchronous call
This commit is contained in:
@@ -536,7 +536,8 @@ def check_for_transaction_rules(
|
|||||||
return transaction
|
return transaction
|
||||||
|
|
||||||
user = get_user_model().objects.get(id=user_id)
|
user = get_user_model().objects.get(id=user_id)
|
||||||
write_current_user(user)
|
if not dry_run:
|
||||||
|
write_current_user(user)
|
||||||
logs = [] if dry_run else None
|
logs = [] if dry_run else None
|
||||||
dry_run_results = DryRunResults(dry_run=dry_run)
|
dry_run_results = DryRunResults(dry_run=dry_run)
|
||||||
|
|
||||||
@@ -761,11 +762,12 @@ def check_for_transaction_rules(
|
|||||||
"** Error while executing 'check_for_transaction_rules' task",
|
"** Error while executing 'check_for_transaction_rules' task",
|
||||||
level="error",
|
level="error",
|
||||||
)
|
)
|
||||||
delete_current_user()
|
|
||||||
if not dry_run:
|
if not dry_run:
|
||||||
|
delete_current_user()
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
delete_current_user()
|
if not dry_run:
|
||||||
|
delete_current_user()
|
||||||
|
|
||||||
return logs, dry_run_results.results
|
return logs, dry_run_results.results
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user