LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
validate user exist on remove organization user method (#905)
ali783f2aa868a6
diff --git a/backend/account_v2/authentication_helper.py b/backend/account_v2/authentication_helper.pyindex e303445fc..d99a424ab 100644--- a/backend/account_v2/authentication_helper.py+++ b/backend/account_v2/authentication_helper.py@@ -109,13 +109,25 @@ class AuthenticationHelper:Parameters:user_id (str): The user_id of the users to remove."""++ organization_user = OrganizationMemberService.get_user_by_user_id(user_id)+ if not organization_user:+ logger.warning(+ f"User removal skipped: User '{user_id}' not found in "+ f"organization '{organization_id}'."+ )+ return+# removing user from organizationOrganizationMemberService.remove_user_by_user_id(user_id)+# removing user m2m relations , while removing userUser.objects.get(user_id=user_id).prompt_registries.clear()User.objects.get(user_id=user_id).shared_custom_tools.clear()User.objects.get(user_id=user_id).shared_adapters_instance.clear()+# removing user from organization cacheOrganizationMemberService.remove_user_membership_in_organization_cache(user_id=user_id, organization_id=organization_id)+ logger.info(f"User '{user_id}' removed from organization '{organization_id}'")