Skip to content

Commit

Permalink
Fixed stared project annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed Jan 19, 2024
1 parent 85c8def commit 8c560a9
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions pepdbagent/modules/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,23 @@ def get_favorites(self, namespace: str) -> AnnotationList:
number_of_projects = len([kk.project_mapping for kk in query_result.stars_mapping])
project_list = []
for prj_list in query_result.stars_mapping:
prj = prj_list.project_mapping
project_list.append(
AnnotationModel(
namespace=prj_list.project_mapping.namespace,
name=prj_list.project_mapping.name,
tag=prj_list.project_mapping.tag,
is_private=prj_list.project_mapping.private,
number_of_samples=prj_list.project_mapping.number_of_samples,
description=prj_list.project_mapping.description,
last_update_date=str(prj_list.project_mapping.last_update_date),
submission_date=str(prj_list.project_mapping.submission_date),
digest=prj_list.project_mapping.digest,
pep_schema=prj_list.project_mapping.pep_schema,
pop=prj_list.project_mapping.pop,
stars_number=prj_list.project_mapping.number_of_stars,
forked_from=f"{prj_list.project_mapping.namespace}/{prj_list.project_mapping.name}:{prj_list.project_mapping.tag}"
if prj_list.project_mapping
namespace=prj.namespace,
name=prj.name,
tag=prj.tag,
is_private=prj.private,
number_of_samples=prj.number_of_samples,
description=prj.description,
last_update_date=str(prj.last_update_date),
submission_date=str(prj.submission_date),
digest=prj.digest,
pep_schema=prj.pep_schema,
pop=prj.pop,
stars_number=prj.number_of_stars,
forked_from=f"{prj.forked_from_mapping.namespace}/{prj.forked_from_mapping.name}:{prj.forked_from_mapping.tag}"
if prj.forked_from_mapping
else None,
)
)
Expand Down

0 comments on commit 8c560a9

Please sign in to comment.