Compare commits
2 commits
master
...
stop-paddl
Author | SHA1 | Date | |
---|---|---|---|
![]() |
57a7565c12 | ||
![]() |
badfe2f752 |
2 changed files with 28 additions and 0 deletions
|
@ -26,6 +26,7 @@ from app.models import (
|
||||||
ProviderComplaint,
|
ProviderComplaint,
|
||||||
Alias,
|
Alias,
|
||||||
Newsletter,
|
Newsletter,
|
||||||
|
PADDLE_SUBSCRIPTION_GRACE_DAYS,
|
||||||
)
|
)
|
||||||
from app.newsletter_utils import send_newsletter_to_user, send_newsletter_to_address
|
from app.newsletter_utils import send_newsletter_to_user, send_newsletter_to_address
|
||||||
|
|
||||||
|
@ -199,6 +200,25 @@ class UserAdmin(SLModelView):
|
||||||
|
|
||||||
Session.commit()
|
Session.commit()
|
||||||
|
|
||||||
|
@action(
|
||||||
|
"stop_paddle_sub",
|
||||||
|
"Stop user Paddle subscription",
|
||||||
|
"This will stop the current user Paddle subscription so if user doesn't have Proton sub, they will lose all SL benefits immediately",
|
||||||
|
)
|
||||||
|
def stop_paddle_sub(self, ids):
|
||||||
|
for user in User.filter(User.id.in_(ids)):
|
||||||
|
sub: Subscription = user.get_paddle_subscription()
|
||||||
|
if not sub:
|
||||||
|
flash(f"No Paddle sub for {user}", "warning")
|
||||||
|
continue
|
||||||
|
|
||||||
|
flash(f"{user} sub will end now, instead of {sub.next_bill_date}", "info")
|
||||||
|
sub.next_bill_date = (
|
||||||
|
arrow.now().shift(days=-PADDLE_SUBSCRIPTION_GRACE_DAYS).date()
|
||||||
|
)
|
||||||
|
|
||||||
|
Session.commit()
|
||||||
|
|
||||||
# @action(
|
# @action(
|
||||||
# "login_as",
|
# "login_as",
|
||||||
# "Login as this user",
|
# "Login as this user",
|
||||||
|
|
|
@ -83,6 +83,14 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if current_user.is_admin %}
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="/admin">
|
||||||
|
<i class="fe fe-server"></i> Admin ☢️
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% if ZENDESK_ENABLED %}
|
{% if ZENDESK_ENABLED %}
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
|
Loading…
Add table
Reference in a new issue