Skip to content

Overdue invoice processing cancels the wrong subscription #672

@allanlasser

Description

@allanlasser

Problem

process_overdue_invoice (tasks.py:384-387) cancels organization.subscription — whatever subscription the org currently has — rather than the subscription linked to the overdue invoice. If an invoice has no subscription (e.g. a manual invoice), this cancels an entirely unrelated subscription.

```python
if organization.subscription:
organization.subscription_cancelled()
```

Fix

Cancel invoice.subscription instead of organization.subscription. If invoice.subscription is None, skip cancellation entirely — there is no subscription to cancel for that invoice.

Files

  • squarelet/organizations/tasks.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions