mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Adding premium renewal to account management dialog.
This commit is contained in:
parent
06be628b52
commit
cece1ba62e
2 changed files with 7 additions and 5 deletions
|
@ -12,6 +12,7 @@ class Command(BaseCommand):
|
|||
def add_arguments(self, parser):
|
||||
parser.add_argument("-d", "--days", dest="days", nargs=1, type=int, default=365, help="Number of days to go back")
|
||||
parser.add_argument("-o", "--offset", dest="offset", nargs=1, type=int, default=0, help="Offset customer (in date DESC)")
|
||||
parser.add_argument("-f", "--force", dest="force", nargs=1, type=bool, default=False, help="Force reimport for every user")
|
||||
|
||||
def handle(self, *args, **options):
|
||||
stripe.api_key = settings.STRIPE_SECRET
|
||||
|
@ -20,8 +21,6 @@ class Command(BaseCommand):
|
|||
limit = 100
|
||||
offset = options.get('offset')
|
||||
|
||||
ignore_user_ids = [18759, 30189, 64184, 254899, 37485, 260097, 244361, 2386, 133148, 102747, 113990, 67222, 5665, 213213, 274, 10462, 240747, 27473, 37748, 85501, 38646, 242379, 53887, 144792, 249582, 126886, 6337, 258479, 43075, 273339, 24347, 178338, 142873, 82601, 18776, 22356, 37524, 124160, 27551, 34427, 35953, 136492, 45476, 14922, 106089, 15848, 33187, 21913, 19860, 43097, 7257, 101133, 147496, 13500, 26762, 44189, 179498, 90799, 44003, 43825, 43861, 43847, 276609, 43007, 43041, 273707, 29652, 171964, 42045, 173859, 109149, 221251, 42344, 29359, 26284, 29251, 10387, 42502, 42043, 42036, 263720, 77766, 41870, 6589, 25411, 262875, 261455, 24292, 41529, 33303, 41343, 40422, 41146, 5561, 71937, 249531, 260228, 258502, 40883, 40859, 40832, 40608, 259295, 218791, 127438, 27354, 27009, 257426, 257289, 7450, 173558, 25773, 4136, 3404, 2251, 3492, 3397, 24927, 39968, 540, 24281, 24095, 24427, 39899, 39887, 17804, 23613, 116173, 3242, 23388, 2760, 22868, 22640, 39465, 39222, 39424, 39268, 238280, 143982, 21964, 246042, 252087, 202824, 38937, 19715, 38704, 139267, 249644, 38549, 249424, 224057, 248477, 236813, 36822, 189335, 139732, 242454, 18817, 37420, 37435, 178748, 206385, 200703, 233798, 177033, 19706, 244002, 167606, 73054, 50543, 19431, 211439, 239137, 36433, 60146, 167373, 19730, 253812]
|
||||
|
||||
while True:
|
||||
logging.debug(" ---> At %s" % offset)
|
||||
user_ids = PaymentHistory.objects.filter(payment_provider='paypal',
|
||||
|
@ -32,9 +31,6 @@ class Command(BaseCommand):
|
|||
break
|
||||
offset += limit
|
||||
for user_id in user_ids:
|
||||
if user_id in ignore_user_ids:
|
||||
# ignore_user_ids can be removed after 2016-05-17
|
||||
continue
|
||||
try:
|
||||
user = User.objects.get(pk=user_id)
|
||||
except User.DoesNotExist:
|
||||
|
@ -49,6 +45,8 @@ class Command(BaseCommand):
|
|||
user.profile.setup_premium_history()
|
||||
elif user.profile.premium_expire > datetime.datetime.now() + datetime.timedelta(days=365):
|
||||
user.profile.setup_premium_history()
|
||||
elif options.get('force'):
|
||||
user.profile.setup_premium_history()
|
||||
else:
|
||||
logging.debug(" ---> %s is fine" % user.username)
|
||||
|
||||
|
|
|
@ -78,6 +78,10 @@ _.extend(NEWSBLUR.ReaderUserAdmin.prototype, {
|
|||
"User is premium, expires: ",
|
||||
(data.premium_expire || $.make('b', 'NEVER'))
|
||||
]));
|
||||
$actions.append($.make('div', { style: 'margin-bottom: 12px' }, [
|
||||
"Premium renewal: ",
|
||||
(data.premium_renewal ? $.make('b', 'Active') : "Off")
|
||||
]));
|
||||
$actions.append($.make('div', { className: "NB-modal-submit-button NB-modal-submit-green NB-admin-action-refund", style: "float: left" }, "Full Refund"));
|
||||
$actions.append($.make('div', { className: "NB-modal-submit-button NB-modal-submit-green NB-admin-action-refund-partial", style: "float: left" }, "Refund $12"));
|
||||
$actions.append($.make('div', { className: "NB-modal-submit-button NB-modal-submit-green NB-admin-action-never-expire", style: "float: left" }, "Never expire"));
|
||||
|
|
Loading…
Add table
Reference in a new issue