mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 15:28:37 -05:00
Don't allow multiple gold subscriptions on an account.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user