forked from open-webui/open-webui
		
	Migrate to python logging module with env var control.
This commit is contained in:
		
							parent
							
								
									d865b9fe59
								
							
						
					
					
						commit
						e6dd0bfbe0
					
				
					 15 changed files with 174 additions and 82 deletions
				
			
		| 
						 | 
				
			
			@ -7,6 +7,7 @@ from fastapi import APIRouter
 | 
			
		|||
from pydantic import BaseModel
 | 
			
		||||
import time
 | 
			
		||||
import uuid
 | 
			
		||||
import logging
 | 
			
		||||
 | 
			
		||||
from apps.web.models.users import UserModel, UserUpdateForm, UserRoleUpdateForm, Users
 | 
			
		||||
from apps.web.models.auths import Auths
 | 
			
		||||
| 
						 | 
				
			
			@ -14,6 +15,10 @@ from apps.web.models.auths import Auths
 | 
			
		|||
from utils.utils import get_current_user, get_password_hash, get_admin_user
 | 
			
		||||
from constants import ERROR_MESSAGES
 | 
			
		||||
 | 
			
		||||
from config import SRC_LOG_LEVELS
 | 
			
		||||
log = logging.getLogger(__name__)
 | 
			
		||||
log.setLevel(SRC_LOG_LEVELS["MODELS"])
 | 
			
		||||
 | 
			
		||||
router = APIRouter()
 | 
			
		||||
 | 
			
		||||
############################
 | 
			
		||||
| 
						 | 
				
			
			@ -83,7 +88,7 @@ async def update_user_by_id(
 | 
			
		|||
 | 
			
		||||
        if form_data.password:
 | 
			
		||||
            hashed = get_password_hash(form_data.password)
 | 
			
		||||
            print(hashed)
 | 
			
		||||
            log.debug(f"hashed: {hashed}")
 | 
			
		||||
            Auths.update_user_password_by_id(user_id, hashed)
 | 
			
		||||
 | 
			
		||||
        Auths.update_email_by_id(user_id, form_data.email.lower())
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue