def _cancel_membership(self, active_membership): cancel_stripe_subscription(active_membership.payment_id) active_membership.end_date = datetime.utcnow() account_repository = AccountRepository(self.db) account_repository.end_membership(active_membership)
def _cancel_membership(self, active_membership): """Cancel the Stripe plan and expire the database row.""" cancel_stripe_subscription(active_membership.payment_id) active_membership.end_date = datetime.utcnow() account_repository = AccountRepository(self.db) account_repository.end_membership(active_membership)