Skip to content

Commit bf9e2a4

Browse files
lumburovskalinaandhreljaKernLennartSchmidtKern
authored
v1.22.0 (#367)
* Links in the notification center navigate to a non existing docs * First name not saved when inviting users * chore: update submodules * fix sender name * recipient name fix * chore: update submodules * fix: add markdown_file_id etl task metadata * perf: add INCOGNITO_USE_OVER_TIME admin query tests * chore: update submodules --------- Co-authored-by: andhreljaKern <[email protected]> Co-authored-by: LennartSchmidtKern <[email protected]>
1 parent 5df7001 commit bf9e2a4

File tree

7 files changed

+15
-56
lines changed

7 files changed

+15
-56
lines changed

controller/inbox_mail/manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ def extend_inbox_mail_sender_receiver_names(
167167
user_is_sender = str(user_id) == str(mail_dict["sender_id"])
168168
sender_is_admin = str(mail_dict["sender_id"]) in admin_user_ids
169169
if is_auto_generated and user_is_admin:
170-
171170
if not (mail_dict.get("sender_id")):
172171
mail_dict["senderName"] = DEFAULT_SYSTEM_AUTOGENERATED_NAME
173172
mail_dict["recipientNames"] = [DEFAULT_KERN_AI_ADMIN_NAME]
@@ -189,6 +188,9 @@ def extend_inbox_mail_sender_receiver_names(
189188
elif user_is_admin and user_is_sender and user_id in participant_ids:
190189
mail_dict["senderName"] = kratos.resolve_user_name_by_id(mail_dict["sender_id"])
191190
mail_dict["recipientNames"] = [DEFAULT_KERN_AI_ADMIN_NAME]
191+
elif user_is_admin and sender_is_admin and not user_is_sender:
192+
mail_dict["senderName"] = kratos.resolve_user_name_by_id(mail_dict["sender_id"])
193+
mail_dict["recipientNames"] = [DEFAULT_KERN_AI_ADMIN_NAME]
192194
elif user_is_admin and sender_is_admin:
193195
mail_dict["senderName"] = DEFAULT_KERN_AI_ADMIN_NAME
194196
mail_dict["recipientNames"] = [

controller/notification/notification_data.py

Lines changed: 0 additions & 53 deletions
Large diffs are not rendered by default.

controller/transfer/cognition/minio_upload.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def handle_cognition_file_upload(path_parts: List[str]):
100100
etl_config_id=markdown_dataset_db_co.get_default_etl_config_id(
101101
str(markdown_file.organization_id), markdown_file.dataset_id
102102
),
103+
markdown_file_id=str(markdown_file.id),
103104
)
104105
etl_task = etl_task_bo.create(
105106
org_id,
@@ -110,6 +111,7 @@ def handle_cognition_file_upload(path_parts: List[str]):
110111
tokenizer=tokenizer,
111112
meta_data={
112113
"file_reference_id": str(file_reference.id),
114+
"markdown_file_id": str(markdown_file.id),
113115
},
114116
priority=priority,
115117
)

fast_api/routes/notification.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def get_notifications(
4545
data = sql_alchemy_to_dict(notifications)
4646
for notification in data:
4747
notification_data = __notification_data.get(notification["type"])
48-
notification["docs"] = notification_data["docs"]
4948
notification["page"] = notification_data["page"]
5049
notification["title"] = notification_data["title"]
5150

fast_api/routes/organization.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
RemoveUserToOrganizationBody,
1616
)
1717
from controller.auth import manager as auth_manager
18+
from controller.auth import kratos
1819
from controller.auth.kratos import (
1920
resolve_user_mail_by_id,
2021
resolve_user_name_by_id,
@@ -95,6 +96,7 @@ def get_user_info(request: Request):
9596
@router.get("/get-user-info-extended")
9697
def get_user_info_extended(request: Request):
9798
user = auth_manager.get_user_by_info(request.state.info)
99+
kratos.__refresh_identity_cache()
98100
name = resolve_user_name_by_id(user.id)
99101
user_dict = {
100102
**sql_alchemy_to_dict(

tests/test_admin_queries.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,12 @@ def __get_default_filter_for_admin_query(query: AdminQueries) -> dict:
9898
"distinct_conversations": False,
9999
}
100100

101+
elif query is AdminQueries.INCOGNITO_USE_OVER_TIME:
102+
return {
103+
"period": "days",
104+
"slices": 7,
105+
"organization_id": "",
106+
}
107+
101108
else:
102109
raise ValueError(f"Unknown admin query: {query}")

0 commit comments

Comments
 (0)