Also, fix for multiple quotes. Without a closing quote subsequent quotes are considered nested, and
will use a ‘ instead of “
Also, move repeated elements to partials
We were making two calls to recurly: one from the SubscriptionController
and another from the SubscriptionViewModelBuilder. This change moves
all the logic to the builder so we only have to do one call.
For a member of a group LimitationsManager.userHasSubscriptionOrIsGroupMember
doesn't return any subscription, so when the controller tries to
access subscription.recurlySubscription_id there's an error.
SubscriptionViewModelBuilder already knows how to handle the case
in which the user is a member of a group but has not subscription
of their own, so guarding against the crash is enough to fix
the issue.
And update the one call-site in LimitationsManager. This function
is used to limit invites, so it makes sense to explicitely limit
this to Invited members of the project.
Squashed commits:
[45c2237] Add a `subscription-form-switch-to-student` event
[1ad9b8f] change experiment name, and re-enable switch-to-student workflow
[f7cdb78] Remove debug
[4b9778a] Incorporate collaborator alternative plans
[701e80b] Add collaborator plans for heron and ibis
[287aa0f] AB test plans from editor page
[c74052e] Fix change-plan view for default plans
[1a947d6] Use correct plan codes
[1eecda7] Adjust prices
[69c4c7b] Introduce two plans
[8b8d5f8] Rename sixpack experiment
[c332002] Fix up the change-plan page
[c7af52d] Overhaul change-plan page, show only plans from current generation
[33d86bf] update plan
[5bbd946] Add a basic plans AB test
This prevents a crash later when we refer to properties
of the plan object, which can end up being `null` when
the `planCode` is either missing, or not a valid code.