forked from open-webui/open-webui
		
	feat: add user from admin panel
This commit is contained in:
		
							parent
							
								
									96af34f240
								
							
						
					
					
						commit
						e6bcdba5ad
					
				
					 5 changed files with 36 additions and 8 deletions
				
			
		|  | @ -90,7 +90,7 @@ class SignupForm(BaseModel): | |||
| 
 | ||||
| 
 | ||||
| class AddUserForm(SignupForm): | ||||
|     role: str = "pending" | ||||
|     role: Optional[str] = "pending" | ||||
| 
 | ||||
| 
 | ||||
| class AuthsTable: | ||||
|  |  | |||
|  | @ -223,14 +223,15 @@ async def signup(form_data: AddUserForm, user=Depends(get_admin_user)): | |||
|         raise HTTPException(400, detail=ERROR_MESSAGES.EMAIL_TAKEN) | ||||
| 
 | ||||
|     try: | ||||
|         role = form_data.role | ||||
| 
 | ||||
|         print(form_data) | ||||
|         hashed = get_password_hash(form_data.password) | ||||
|         user = Auths.insert_new_auth( | ||||
|             form_data.email.lower(), | ||||
|             hashed, | ||||
|             form_data.name, | ||||
|             form_data.profile_image_url, | ||||
|             role, | ||||
|             form_data.role, | ||||
|         ) | ||||
| 
 | ||||
|         if user: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek