Commit cc0d1022 authored by David Seaward's avatar David Seaward
Browse files

Contain subscription-related errors.

Signed-off-by: David Seaward's avatarDavid Seaward <>
parent aafed233
Pipeline #54238 passed with stage
in 31 seconds
......@@ -10,6 +10,9 @@ from .forms import CartRegistrationFormWithCaptcha, CartRegistrationForm
from limitmonitor.common import forced_update
from limitmonitor.subscription import SubscriptionManager, SubscriptionStatus
import json
import logging
log = logging.getLogger(__name__)
class CartRegistrationView(RegistrationView):
......@@ -77,16 +80,23 @@ class CartRegistrationView(RegistrationView):
if self.bundle == 'Basic':
user.account_type = AccountType.BASIC
new_sub = SubscriptionManager.create_subscription(
user, paid=True,
assert new_sub is not None, "Failed to create subscription for {}".format(user)
if new_sub is None:
raise Exception("Subscription is None.")
except Exception as e:
message = "Failed to create subscription for basic user {}.".format(user)
elif self.bundle == 'Complete':
user.account_type = AccountType.COMPLETE
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment