Skip to content

Commit

Permalink
Unit metadata update time
Browse files Browse the repository at this point in the history
* When sending metadata, also update the unit doc to show last_updated date.
  • Loading branch information
wtgee committed May 22, 2024
1 parent df97778 commit 5c12f97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/panoptes/pocs/utils/cli/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ def handleEvent(event):
print(f'Adding data for {record_type=}: {data}')

# Update the unit's metadata with the record_type.
unit_ref.set({'metadata': {record_type: data}}, merge=True)
unit_ref.set({

Check warning on line 124 in src/panoptes/pocs/utils/cli/network.py

View check run for this annotation

Codecov / codecov/patch

src/panoptes/pocs/utils/cli/network.py#L124

Added line #L124 was not covered by tests
'metadata': {
record_type: data
},
'last_updated': firestore.SERVER_TIMESTAMP,
}, merge=True)

# Add the record, storing the record_type name in the data.
data['record_type'] = record_type
Expand Down

0 comments on commit 5c12f97

Please sign in to comment.