diff --git a/pyproject.toml b/pyproject.toml index 65068874..a59d1d6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,7 +111,6 @@ ignore = [ "SIM105", # Use `contextlib.suppress` "SIM117", # Avoid repeated `with` statements "TRY200", # Use `raise from` to preserve context (also see B904) - "TRY400", # Use logging.exception, not logging.error ] # By default, `ruff` will respect `.gitignore` diff --git a/ws/signals/signup_signals.py b/ws/signals/signup_signals.py index a304a1e6..95fa78b5 100644 --- a/ws/signals/signup_signals.py +++ b/ws/signals/signup_signals.py @@ -113,7 +113,7 @@ def revoke_existing_task(sender, instance, raw, using, update_fields, **kwargs): app.control.revoke(trip.lottery_task_id) except OperationalError: # Log the exception, but don't raise exceptions, preventing trip saving - logger.error("Failed to revoke lottery task for trip %s", trip.pk) + logger.exception("Failed to revoke lottery task for trip %s", trip.pk) else: instance.lottery_task_id = None @@ -135,7 +135,7 @@ def add_lottery_task(sender, instance, created, raw, using, update_fields, **kwa try: task_id = tasks.run_lottery.apply_async((trip.pk,), eta=trip.signups_close_at) except OperationalError: - logger.error("Failed to make lottery task for trip %s", trip.pk) + logger.exception("Failed to make lottery task for trip %s", trip.pk) else: trip.lottery_task_id = task_id # Use update() to avoid repeated signal on post_save diff --git a/ws/views/participant.py b/ws/views/participant.py index f7ac103c..69d06700 100644 --- a/ws/views/participant.py +++ b/ws/views/participant.py @@ -173,7 +173,7 @@ def post(self, request, *args, **kwargs): try: tasks.update_participant_affiliation.delay(participant.pk) except OperationalError: - logger.error( + logger.exception( "Unable to update affiliation to %s for participant %s", participant.pk, participant.affiliation,