forked from open-webui/open-webui
		
	feat: use local profile image by default
This commit is contained in:
		
							parent
							
								
									3ce8f3e8fb
								
							
						
					
					
						commit
						0c322063b5
					
				
					 4 changed files with 72 additions and 31 deletions
				
			
		|  | @ -65,7 +65,7 @@ class UsersTable: | |||
|                 "name": name, | ||||
|                 "email": email, | ||||
|                 "role": role, | ||||
|                 "profile_image_url": get_gravatar_url(email), | ||||
|                 "profile_image_url": "/user.png", | ||||
|                 "timestamp": int(time.time()), | ||||
|             } | ||||
|         ) | ||||
|  |  | |||
|  | @ -9,7 +9,7 @@ import os | |||
| import aiohttp | ||||
| import json | ||||
| 
 | ||||
| from utils.misc import calculate_sha256 | ||||
| from utils.misc import calculate_sha256, get_gravatar_url | ||||
| 
 | ||||
| from config import OLLAMA_API_BASE_URL, DATA_DIR, UPLOAD_DIR | ||||
| from constants import ERROR_MESSAGES | ||||
|  | @ -165,3 +165,10 @@ def upload(file: UploadFile = File(...)): | |||
|             yield f"data: {json.dumps(res)}\n\n" | ||||
| 
 | ||||
|     return StreamingResponse(file_process_stream(), media_type="text/event-stream") | ||||
| 
 | ||||
| 
 | ||||
| @router.get("/gravatar") | ||||
| async def get_gravatar( | ||||
|     email: str, | ||||
| ): | ||||
|     return get_gravatar_url(email) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek