diff --git a/confirmation/migrations/0009_confirmation_expiry_date_backfill.py b/confirmation/migrations/0009_confirmation_expiry_date_backfill.py index 6115a1c8ca..a041e6091b 100644 --- a/confirmation/migrations/0009_confirmation_expiry_date_backfill.py +++ b/confirmation/migrations/0009_confirmation_expiry_date_backfill.py @@ -21,7 +21,7 @@ def set_expiry_date_for_existing_confirmations( UNSUBSCRIBE = 4 MULTIUSE_INVITE = 6 - @transaction.atomic() + @transaction.atomic def backfill_confirmations_between(lower_bound: int, upper_bound: int) -> None: confirmations = Confirmation.objects.filter(id__gte=lower_bound, id__lte=upper_bound) for confirmation in confirmations: diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index c1c3d1d40c..f9a8b2b8a5 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -481,6 +481,10 @@ python_rules = RuleList( "pattern": "\\.(called(_once|_with|_once_with)?|not_called|has_calls|not_called)[(]", "description": 'A mock function is missing a leading "assert_"', }, + { + "pattern": "@transaction.atomic\\(\\)", + "description": "Use @transaction.atomic as function decorator for consistency.", + }, *whitespace_rules, ], max_length=110,