mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-07 07:58:09 +00:00
Refactor tag validation for premium users
This commit is contained in:
parent
2292b6530c
commit
ae13dc6f6b
1 changed files with 2 additions and 4 deletions
|
|
@ -1666,12 +1666,10 @@ async def _common_key_generation_helper(
|
|||
# Set tags on the new key
|
||||
if "tags" in data_json:
|
||||
from litellm.proxy.proxy_server import premium_user
|
||||
|
||||
|
||||
tags = data_json.get("tags")
|
||||
if premium_user is not True and isinstance(tags, list) and len(tags) > 0:
|
||||
raise ValueError(
|
||||
f"Only premium users can add tags to keys. {CommonProxyErrors.not_premium_user.value}"
|
||||
)
|
||||
raise ValueError(f"Only premium users can add tags to keys. {CommonProxyErrors.not_premium_user.value}")
|
||||
|
||||
_metadata: Final = data_json.get("metadata")
|
||||
if tags is None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue