Skip to content

Commit

Permalink
add creation date to indexed projects in Elasticsearch (#1507)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarosenb authored Jan 15, 2025
1 parent 90033c4 commit 175eb1a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions designsafe/apps/api/projects_v2/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@ def index_project(project_id):
project_json = nx.node_link_data(project_tree)
try:
pub_es = IndexedProject.get(project_id)
pub_es.update(**project_json, uuid=project_meta.uuid, value=project_meta.value)
pub_es.update(
**project_json,
uuid=project_meta.uuid,
value=project_meta.value,
created=project_meta.created
)

except NotFoundError:
pub_es = IndexedProject(
**project_json, uuid=project_meta.uuid, value=project_meta.value
**project_json,
uuid=project_meta.uuid,
value=project_meta.value,
created=project_meta.created
)
pub_es.meta["id"] = project_id
pub_es.save()
Expand Down

0 comments on commit 175eb1a

Please sign in to comment.