Browse Source

fix: send webhook notification when user is not active

Timothy Jaeryang Baek 1 month ago
parent
commit
079af5fffe
1 changed files with 2 additions and 2 deletions
  1. 2 2
      backend/open_webui/utils/middleware.py

+ 2 - 2
backend/open_webui/utils/middleware.py

@@ -1133,7 +1133,7 @@ async def process_chat_response(
                     )
 
                     # Send a webhook notification if the user is not active
-                    if get_active_status_by_user_id(user.id):
+                    if not get_active_status_by_user_id(user.id):
                         webhook_url = Users.get_user_webhook_url_by_id(user.id)
                         if webhook_url:
                             post_webhook(
@@ -2224,7 +2224,7 @@ async def process_chat_response(
                     )
 
                 # Send a webhook notification if the user is not active
-                if get_active_status_by_user_id(user.id):
+                if not get_active_status_by_user_id(user.id):
                     webhook_url = Users.get_user_webhook_url_by_id(user.id)
                     if webhook_url:
                         post_webhook(