Allow employees to gift gold for free.

This commit is contained in:
Ricky Ramirez
2013-08-08 16:40:41 -07:00
parent ad2d41f7e7
commit 0fabf570d1
2 changed files with 5 additions and 5 deletions

View File

@@ -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()

View File

@@ -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