thunderbird_accounts.subscription.utils

Functions

activate_subscription_features(user, plan)

Activates a plan.

deactivate_subscription_features()

TODO: Implement me

sync_plan_to_keycloak(user)

Sync the user's plan information according to the state of user.has_active_subscription.

thunderbird_accounts.subscription.utils.sync_plan_to_keycloak(user: User)[source]

Sync the user’s plan information according to the state of user.has_active_subscription. If they don’t have an active subscription then they’re not subscribed and can’t access their services. Note that deactivating the plan (is_subscribed=False) will not adjust their plan information.

If their plan is active then this will update their plan information as well as setting is_subscribed=True.

thunderbird_accounts.subscription.utils.activate_subscription_features(user: User, plan: Plan)[source]

Activates a plan. Which right now just saves the plan_id on the user, creates the mail account if one doesn’t exist, or updates an existing mail account’s quota.

thunderbird_accounts.subscription.utils.deactivate_subscription_features()[source]

TODO: Implement me