Skip to content

Commit 031adc9

Browse files
Lendemormasenf
authored andcommitted
remove unused function (#4870)
1 parent 527ce1f commit 031adc9

File tree

1 file changed

+1
-36
lines changed

1 file changed

+1
-36
lines changed

reflex/utils/prerequisites.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from datetime import datetime
2424
from pathlib import Path
2525
from types import ModuleType
26-
from typing import Any, Callable, List, NamedTuple, Optional
26+
from typing import Callable, List, NamedTuple, Optional
2727
from urllib.parse import urlparse
2828

2929
import httpx
@@ -2025,38 +2025,3 @@ def get_user_tier():
20252025
if authenticated_token[0]
20262026
else "anonymous"
20272027
)
2028-
2029-
2030-
def check_config_option_in_tier(
2031-
option_name: str,
2032-
allowed_tiers: list[str],
2033-
fallback_value: Any,
2034-
help_link: str | None = None,
2035-
):
2036-
"""Check if a config option is allowed for the authenticated user's current tier.
2037-
2038-
Args:
2039-
option_name: The name of the option to check.
2040-
allowed_tiers: The tiers that are allowed to use the option.
2041-
fallback_value: The fallback value if the option is not allowed.
2042-
help_link: The help link to show to a user that is authenticated.
2043-
"""
2044-
config = get_config()
2045-
current_tier = get_user_tier()
2046-
2047-
if current_tier == "anonymous":
2048-
the_remedy = (
2049-
"You are currently logged out. Run `reflex login` to access this option."
2050-
)
2051-
else:
2052-
the_remedy = (
2053-
f"Your current subscription tier is `{current_tier}`. "
2054-
f"Please upgrade to {allowed_tiers} to access this option. "
2055-
)
2056-
if help_link:
2057-
the_remedy += f"See {help_link} for more information."
2058-
2059-
if current_tier not in allowed_tiers:
2060-
console.warn(f"Config option `{option_name}` is restricted. {the_remedy}")
2061-
setattr(config, option_name, fallback_value)
2062-
config._set_persistent(**{option_name: fallback_value})

0 commit comments

Comments
 (0)