mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
No archive or pro for 2k+.
This commit is contained in:
parent
5731816ca1
commit
2418d2fc6e
1 changed files with 14 additions and 2 deletions
|
@ -283,6 +283,13 @@ class Profile(models.Model):
|
|||
def activate_archive(self, never_expire=False):
|
||||
UserSubscription.schedule_fetch_archive_feeds_for_user(self.user.pk)
|
||||
|
||||
subs = UserSubscription.objects.filter(user=self.user)
|
||||
if subs.count() > 2000:
|
||||
logging.user(self.user, "~FR~SK~FW~SBWARNING! ~FR%s subscriptions~SN!" % (subs.count()))
|
||||
mail_admins(f"WARNING! {self.user.username} has {subs.count()} subscriptions",
|
||||
f"{self.user.username} has {subs.count()} subscriptions and just upgraded to archive. They'll need a refund: {self.user.profile.paypal_sub_id} {self.user.profile.stripe_id} {self.user.email}")
|
||||
return False
|
||||
|
||||
was_premium = self.is_premium
|
||||
was_archive = self.is_archive
|
||||
was_pro = self.is_pro
|
||||
|
@ -293,7 +300,6 @@ class Profile(models.Model):
|
|||
self.user.save()
|
||||
|
||||
# Only auto-enable every feed if a free user is moving to premium
|
||||
subs = UserSubscription.objects.filter(user=self.user)
|
||||
if not was_premium:
|
||||
for sub in subs:
|
||||
if sub.active: continue
|
||||
|
@ -331,6 +337,13 @@ class Profile(models.Model):
|
|||
|
||||
EmailNewPremiumPro.delay(user_id=self.user.pk)
|
||||
|
||||
subs = UserSubscription.objects.filter(user=self.user)
|
||||
if subs.count() > 2000:
|
||||
logging.user(self.user, "~FR~SK~FW~SBWARNING! ~FR%s subscriptions~SN!" % (subs.count()))
|
||||
mail_admins(f"WARNING! {self.user.username} has {subs.count()} subscriptions",
|
||||
f"{self.user.username} has {subs.count()} subscriptions and just upgraded to pro. They'll need a refund: {self.user.profile.paypal_sub_id} {self.user.profile.stripe_id} {self.user.email}")
|
||||
return False
|
||||
|
||||
was_premium = self.is_premium
|
||||
was_archive = self.is_archive
|
||||
was_pro = self.is_pro
|
||||
|
@ -342,7 +355,6 @@ class Profile(models.Model):
|
|||
self.user.save()
|
||||
|
||||
# Only auto-enable every feed if a free user is moving to premium
|
||||
subs = UserSubscription.objects.filter(user=self.user)
|
||||
if not was_premium:
|
||||
for sub in subs:
|
||||
if sub.active: continue
|
||||
|
|
Loading…
Add table
Reference in a new issue