admin can go directly to paddle (#1263)
This commit is contained in:
parent
96e6753c95
commit
25773448c2
|
@ -93,6 +93,10 @@ class SLAdminIndexView(AdminIndexView):
|
|||
return redirect("/admin/user")
|
||||
|
||||
|
||||
def _user_upgrade_channel_formatter(view, context, model, name):
|
||||
return Markup(model.upgrade_channel)
|
||||
|
||||
|
||||
class UserAdmin(SLModelView):
|
||||
column_searchable_list = ["email", "id"]
|
||||
column_exclude_list = [
|
||||
|
@ -110,6 +114,10 @@ class UserAdmin(SLModelView):
|
|||
ret.insert(0, "upgrade_channel")
|
||||
return ret
|
||||
|
||||
column_formatters = {
|
||||
"upgrade_channel": _user_upgrade_channel_formatter,
|
||||
}
|
||||
|
||||
@action(
|
||||
"education_upgrade",
|
||||
"Education upgrade",
|
||||
|
|
|
@ -720,11 +720,11 @@ class User(Base, ModelMixin, UserMixin, PasswordOracle):
|
|||
if sub:
|
||||
if sub.cancelled:
|
||||
channels.append(
|
||||
f"Cancelled Paddle Subscription {sub.subscription_id} {sub.plan_name()} ends at {sub.next_bill_date}"
|
||||
f"""Cancelled Paddle Subscription <a href="https://vendors.paddle.com/subscriptions/customers/manage/{sub.subscription_id}">{sub.subscription_id}</a> {sub.plan_name()} ends at {sub.next_bill_date}"""
|
||||
)
|
||||
else:
|
||||
channels.append(
|
||||
f"Active Paddle Subscription {sub.subscription_id} {sub.plan_name()}, renews at {sub.next_bill_date}"
|
||||
f"""Active Paddle Subscription <a href="https://vendors.paddle.com/subscriptions/customers/manage/{sub.subscription_id}">{sub.subscription_id}</a> {sub.plan_name()}, renews at {sub.next_bill_date}"""
|
||||
)
|
||||
|
||||
apple_sub: AppleSubscription = AppleSubscription.get_by(user_id=self.id)
|
||||
|
|
Loading…
Reference in a new issue