Don't allow multiple gold subscriptions on an account.

This commit is contained in:
Brian Simpson
2013-10-24 09:03:08 -04:00
parent 19d9968455
commit 1a03651dee
3 changed files with 8 additions and 3 deletions

View File

@@ -1469,10 +1469,12 @@ class FormsController(RedditController):
start_over = True
if start_over:
can_subscribe = not c.user.has_gold_subscription
return BoringPage(_("reddit gold"),
show_sidebar=False,
content=Gold(goldtype, period, months, signed,
recipient, recipient_name)).render()
recipient, recipient_name,
can_subscribe=can_subscribe)).render()
else:
payment_blob = dict(goldtype=goldtype,
account_id=c.user._id,

View File

@@ -2127,7 +2127,7 @@ class GoldThanks(Templated):
class Gold(Templated):
def __init__(self, goldtype, period, months, signed,
recipient, recipient_name):
recipient, recipient_name, can_subscribe=True):
if c.user.employee:
user_creddits = 50
@@ -2139,7 +2139,8 @@ class Gold(Templated):
recipient_name = recipient_name,
user_creddits = user_creddits,
bad_recipient =
bool(recipient_name and not recipient))
bool(recipient_name and not recipient),
can_subscribe=can_subscribe)
class GoldPayment(Templated):

View File

@@ -86,8 +86,10 @@
<form class="content">
<%utils:round_field title="">
%if thing.can_subscribe:
${radio_type("goldtype", "autorenew", _("Buy for yourself, as an ongoing subscription"),
"", thing.goldtype == "autorenew")}<br/>
%endif
${radio_type("goldtype", "onetime", _("Buy for yourself, as a one-time purchase"),
"", thing.goldtype == "onetime")}<br/>
${radio_type("goldtype", "gift", _("Give reddit gold to someone else"),