Commit 0ffb3bc8 authored by Birin Sanchez's avatar Birin Sanchez
Browse files

Add 5 year subscription support.


Signed-off-by: Birin Sanchez's avatarBirin Sanchez <birin.sanchez@puri.sm>
parent dc5a62aa
Pipeline #47509 passed with stage
in 32 seconds
......@@ -128,6 +128,17 @@ class CartRegistrationForm(RegistrationForm):
self.fields['bundle_choice'] = hidden_bundle
self.fields['period_choice'] = hidden_period
# Complete 5 years
elif (
len(periods) > 2 and
layout == (bundles[1] + '_' + periods[2]).lower().replace(' ', '_')
):
hidden_bundle.initial = bundles[1]
hidden_period.initial = periods[2]
self.fields['bundle_choice'] = hidden_bundle
self.fields['period_choice'] = hidden_period
# Family filter: bundle is hidden and user can choose period
elif layout == bundles[2].lower():
......@@ -151,6 +162,17 @@ class CartRegistrationForm(RegistrationForm):
self.fields['bundle_choice'] = hidden_bundle
self.fields['period_choice'] = hidden_period
# Family 5 years
elif (
len(periods) > 2 and
layout == (bundles[2] + '_' + periods[2]).lower().replace(' ', '_')
):
hidden_bundle.initial = bundles[2]
hidden_period.initial = periods[2]
self.fields['bundle_choice'] = hidden_bundle
self.fields['period_choice'] = hidden_period
# Form used by invitation registration: No extra fields added
elif layout == 'Invitee':
pass
......
......@@ -27,6 +27,7 @@ class SubscriptionStatus(Enum):
class BillingPeriod(Enum):
MONTHLY = 'monthly'
ANNUAL = 'annual'
FIVEYEARS = '5years'
class SubscriptionParseError(Exception):
......
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