Skip to content
Merged
4 changes: 3 additions & 1 deletion controller/inbox_mail/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def extend_inbox_mail_sender_receiver_names(
user_is_sender = str(user_id) == str(mail_dict["sender_id"])
sender_is_admin = str(mail_dict["sender_id"]) in admin_user_ids
if is_auto_generated and user_is_admin:

if not (mail_dict.get("sender_id")):
mail_dict["senderName"] = DEFAULT_SYSTEM_AUTOGENERATED_NAME
mail_dict["recipientNames"] = [DEFAULT_KERN_AI_ADMIN_NAME]
Expand All @@ -189,6 +188,9 @@ def extend_inbox_mail_sender_receiver_names(
elif user_is_admin and user_is_sender and user_id in participant_ids:
mail_dict["senderName"] = kratos.resolve_user_name_by_id(mail_dict["sender_id"])
mail_dict["recipientNames"] = [DEFAULT_KERN_AI_ADMIN_NAME]
elif user_is_admin and sender_is_admin and not user_is_sender:
mail_dict["senderName"] = kratos.resolve_user_name_by_id(mail_dict["sender_id"])
mail_dict["recipientNames"] = [DEFAULT_KERN_AI_ADMIN_NAME]
elif user_is_admin and sender_is_admin:
mail_dict["senderName"] = DEFAULT_KERN_AI_ADMIN_NAME
mail_dict["recipientNames"] = [
Expand Down
53 changes: 0 additions & 53 deletions controller/notification/notification_data.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions controller/transfer/cognition/minio_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def handle_cognition_file_upload(path_parts: List[str]):
etl_config_id=markdown_dataset_db_co.get_default_etl_config_id(
str(markdown_file.organization_id), markdown_file.dataset_id
),
markdown_file_id=str(markdown_file.id),
)
etl_task = etl_task_bo.create(
org_id,
Expand All @@ -110,6 +111,7 @@ def handle_cognition_file_upload(path_parts: List[str]):
tokenizer=tokenizer,
meta_data={
"file_reference_id": str(file_reference.id),
"markdown_file_id": str(markdown_file.id),
},
priority=priority,
)
Expand Down
1 change: 0 additions & 1 deletion fast_api/routes/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def get_notifications(
data = sql_alchemy_to_dict(notifications)
for notification in data:
notification_data = __notification_data.get(notification["type"])
notification["docs"] = notification_data["docs"]
notification["page"] = notification_data["page"]
notification["title"] = notification_data["title"]

Expand Down
2 changes: 2 additions & 0 deletions fast_api/routes/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
RemoveUserToOrganizationBody,
)
from controller.auth import manager as auth_manager
from controller.auth import kratos
from controller.auth.kratos import (
resolve_user_mail_by_id,
resolve_user_name_by_id,
Expand Down Expand Up @@ -95,6 +96,7 @@ def get_user_info(request: Request):
@router.get("/get-user-info-extended")
def get_user_info_extended(request: Request):
user = auth_manager.get_user_by_info(request.state.info)
kratos.__refresh_identity_cache()
name = resolve_user_name_by_id(user.id)
user_dict = {
**sql_alchemy_to_dict(
Expand Down
2 changes: 1 addition & 1 deletion submodules/model
7 changes: 7 additions & 0 deletions tests/test_admin_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,12 @@ def __get_default_filter_for_admin_query(query: AdminQueries) -> dict:
"distinct_conversations": False,
}

elif query is AdminQueries.INCOGNITO_USE_OVER_TIME:
return {
"period": "days",
"slices": 7,
"organization_id": "",
}

else:
raise ValueError(f"Unknown admin query: {query}")
Loading