feat: add TRIAL_DISABLED_FOR setting to disable trial by user type
New setting allows granular control over trial availability: - none: trial available for all (default) - email: trial disabled for email users - telegram: trial disabled for telegram users - all: trial disabled for everyone Enforced in bot handlers, cabinet API, and miniapp routes. Automatically appears in admin panel as dropdown via CHOICES.
This commit is contained in:
@@ -3047,6 +3047,9 @@ def _is_trial_available_for_user(user: User) -> bool:
|
||||
if settings.TRIAL_DURATION_DAYS <= 0:
|
||||
return False
|
||||
|
||||
if settings.is_trial_disabled_for_user(getattr(user, 'auth_type', 'telegram')):
|
||||
return False
|
||||
|
||||
if getattr(user, 'has_had_paid_subscription', False):
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user