Conversation
| "proration_behavior": "none", | ||
| }, | ||
| ], | ||
| ) |
There was a problem hiding this comment.
Missing cleanup leaves orphaned schedule on partial failure
Medium Severity
If SubscriptionSchedule.create() succeeds but SubscriptionSchedule.modify() fails, the created schedule is left attached to the subscription without the intended target plan phases. On subsequent runs, the idempotency check sees the subscription "already has schedule" and skips it, leaving the subscription stuck with an improperly configured schedule that won't transition to the target plan. The command claims to be idempotent but this failure mode breaks that guarantee.
Additional Locations (1)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #681 +/- ##
==========================================
- Coverage 92.43% 92.39% -0.04%
==========================================
Files 1297 1298 +1
Lines 47730 47760 +30
Branches 1606 1610 +4
==========================================
+ Hits 44119 44128 +9
- Misses 3302 3323 +21
Partials 309 309
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| owners = owners.filter(plan_user_count__gte=options["min_quantity"]) | ||
|
|
||
| if options["max_quantity"]: | ||
| owners = owners.filter(plan_user_count__lte=options["max_quantity"]) |
There was a problem hiding this comment.
Falsy check skips filter when quantity is zero
Medium Severity
The --min-quantity and --max-quantity filters use truthiness checks (if options["min_quantity"]:) instead of is not None checks. Since 0 is falsy in Python, passing --max-quantity 0 would silently skip the filter entirely, causing all subscriptions to be processed instead of only those with zero seats. This could lead to unintended billing changes. The same file correctly uses is not None for target_quantity (lines 260, 266), making this inconsistency likely an oversight.
* Prepare release 26.2.2 * add version 26.2.2 migration * chore: retrigger CI checks --------- Co-authored-by: Calvin Yau <[email protected]> Co-authored-by: jasonford <[email protected]>


Release PR for 26.2.2
I've updated the version name and committed: 50489e0.
Note
Medium Risk
Adds a bulk management command that can create/modify Stripe subscription schedules across many customers; misuse or bugs could impact billing if run without
--dry-run/proper filters. Version bump and migration are low risk but accompany the release.Overview
Bumps the application version to
26.2.2(updatesVERSIONand adds acoremigration to persist the new version inConstants).Adds a new Django management command
apply_subscription_schedulesto bulk-create Stripe subscription schedules for selected owners, supporting filtering (owner IDs, current plan, service, seat ranges), pagination,--dry-run, and--force(releases an existing schedule before recreating). The command is designed to be idempotent by skipping subscriptions already scheduled or already on the target Stripe price/quantity.Written by Cursor Bugbot for commit e2c2baf. This will update automatically on new commits. Configure here.