Skip to content

Commit

Permalink
hotfix: fix error on cc-pair get endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Amboyandrey committed Sep 19, 2024
1 parent f59333d commit 3e60422
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
19 changes: 0 additions & 19 deletions backend/enmedd/server/documents/cc_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
from enmedd.server.documents.models import CCPairFullInfo
from enmedd.server.documents.models import ConnectorCredentialPairIdentifier
from enmedd.server.documents.models import ConnectorCredentialPairMetadata
from enmedd.server.models import MinimalTeamspaceSnapshot
from enmedd.server.models import MinimalWorkspaceSnapshot
from enmedd.server.models import StatusResponse

router = APIRouter(prefix="/manage")
Expand Down Expand Up @@ -66,28 +64,11 @@ def get_cc_pair_full_info(
db_session=db_session,
)

groups = (
[
MinimalTeamspaceSnapshot(
id=teamspace.id,
name=teamspace.name,
workspace=[
MinimalWorkspaceSnapshot(
id=workspace.id, workspace_name=workspace.workspace_name
)
for workspace in teamspace.workspace
],
)
for teamspace in cc_pair.groups
],
)

return CCPairFullInfo.from_models(
cc_pair_model=cc_pair,
index_attempt_models=list(index_attempts),
latest_deletion_attempt=latest_deletion_attempt,
num_docs_indexed=documents_indexed,
groups=groups,
)


Expand Down
2 changes: 0 additions & 2 deletions backend/enmedd/server/documents/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def from_models(
cc_pair_model: ConnectorCredentialPair,
index_attempt_models: list[IndexAttempt],
latest_deletion_attempt: DeletionAttemptSnapshot | None,
groups: list[MinimalTeamspaceSnapshot] | None,
num_docs_indexed: int, # not ideal, but this must be computed separately
) -> "CCPairFullInfo":
return cls(
Expand All @@ -158,7 +157,6 @@ def from_models(
for index_attempt_model in index_attempt_models
],
latest_deletion_attempt=latest_deletion_attempt,
groups=groups,
)


Expand Down

0 comments on commit 3e60422

Please sign in to comment.