mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
Allow employees to gift gold for free.
This commit is contained in:
@@ -341,7 +341,7 @@ class IpnController(RedditController):
|
||||
form.set_html(".status", _("that user has deleted their account"))
|
||||
return
|
||||
|
||||
if not c.user_is_admin:
|
||||
if not c.user.employee:
|
||||
if months > c.user.gold_creddits:
|
||||
raise ValueError("%s is trying to sneak around the creddit check"
|
||||
% c.user.name)
|
||||
@@ -354,7 +354,7 @@ class IpnController(RedditController):
|
||||
comment = send_gift(c.user, recipient, months, days, signed,
|
||||
giftmessage, comment_id)
|
||||
|
||||
if not c.user_is_admin:
|
||||
if not c.user.employee:
|
||||
c.user.gold_creddit_escrow -= months
|
||||
c.user._commit()
|
||||
|
||||
|
||||
@@ -1959,7 +1959,7 @@ class Gold(Templated):
|
||||
def __init__(self, goldtype, period, months, signed,
|
||||
recipient, recipient_name):
|
||||
|
||||
if c.user_is_admin:
|
||||
if c.user.employee:
|
||||
user_creddits = 50
|
||||
else:
|
||||
user_creddits = c.user.gold_creddits
|
||||
@@ -1992,7 +1992,7 @@ class GoldPayment(Templated):
|
||||
years = months / 12
|
||||
price = unit_price * years
|
||||
|
||||
if c.user_is_admin:
|
||||
if c.user.employee:
|
||||
user_creddits = 50
|
||||
else:
|
||||
user_creddits = c.user.gold_creddits
|
||||
@@ -2096,7 +2096,7 @@ class CreditGild(Templated):
|
||||
class GiftGold(Templated):
|
||||
"""The page to gift reddit gold trophies"""
|
||||
def __init__(self, recipient):
|
||||
if c.user_is_admin:
|
||||
if c.user.employee:
|
||||
gold_creddits = 500
|
||||
else:
|
||||
gold_creddits = c.user.gold_creddits
|
||||
|
||||
Reference in New Issue
Block a user