From 75c11e57a362584e9ff497112a20923f9410b5f1 Mon Sep 17 00:00:00 2001 From: Birk Jernstrom Date: Fri, 3 Jan 2025 14:23:54 +0100 Subject: [PATCH] server: Enhanced code documentation for early cancellation exit --- server/polar/subscription/service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/polar/subscription/service.py b/server/polar/subscription/service.py index ffd4605f9e..d4e87ed9ad 100644 --- a/server/polar/subscription/service.py +++ b/server/polar/subscription/service.py @@ -615,7 +615,8 @@ async def update( cancel = updates.cancel_at_period_end is True uncancel = updates.cancel_at_period_end is False - if not (updates.revoke or cancel or uncancel): + # Exit early unless we're asked to revoke, cancel or uncancel + if not any((updates.revoke, cancel, uncancel)): return subscription if updates.revoke and (cancel or uncancel):