mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
fix(create_user_button.tsx): do not set 'no-default-models' when user is a proxy admin
This commit is contained in:
parent
1014529ed6
commit
44e459486c
1 changed files with 3 additions and 2 deletions
|
@ -117,13 +117,14 @@ const Createuser: React.FC<CreateuserProps> = ({
|
|||
form.resetFields();
|
||||
};
|
||||
|
||||
const handleCreate = async (formValues: { user_id: string, models?: string[] }) => {
|
||||
const handleCreate = async (formValues: { user_id: string, models?: string[], user_role: string }) => {
|
||||
try {
|
||||
message.info("Making API Call");
|
||||
if (!isEmbedded) {
|
||||
setIsModalVisible(true);
|
||||
}
|
||||
if (!formValues.models || formValues.models.length === 0) {
|
||||
if ((!formValues.models || formValues.models.length === 0) && formValues.user_role !== "proxy_admin") {
|
||||
console.log("formValues.user_role", formValues.user_role)
|
||||
// If models is empty or undefined, set it to "no-default-models"
|
||||
formValues.models = ["no-default-models"];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue