From 0fabf570d1cccf9c53b29a2a9f8328cf66773e42 Mon Sep 17 00:00:00 2001 From: Ricky Ramirez Date: Thu, 8 Aug 2013 16:40:41 -0700 Subject: [PATCH] Allow employees to gift gold for free. --- r2/r2/controllers/ipn.py | 4 ++-- r2/r2/lib/pages/pages.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/r2/r2/controllers/ipn.py b/r2/r2/controllers/ipn.py index 933459235..3805e8b9e 100644 --- a/r2/r2/controllers/ipn.py +++ b/r2/r2/controllers/ipn.py @@ -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() diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index a11d78bba..b1cb2787c 100755 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -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