Skip to content

Commit

Permalink
Merge pull request #130 from stuartcampbell/quick_fix
Browse files Browse the repository at this point in the history
Quick fix for field name
  • Loading branch information
stuartcampbell authored Jan 13, 2025
2 parents e12eade + d29df4e commit 963f6d4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/nsls2api/services/sync_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ async def worker_synchronize_cycles_from_pass(
pass_id=str(pass_cycle.ID),
)

updated_cycle = await Cycle.find_one(Cycle.name == pass_cycle.Name, Cycle.facility == facility.facility_name).upsert(
updated_cycle = await Cycle.find_one(
Cycle.name == pass_cycle.Name, Cycle.facility == facility.facility_id
).upsert(
Set(
{
Cycle.accepting_proposals: cycle.accepting_proposals,
Expand All @@ -132,7 +134,9 @@ async def worker_synchronize_cycles_from_pass(
)

# Now let's update the list of proposals for this cycle
proposals_list = await pass_service.get_proposals_allocated_by_cycle(cycle.name, facility=facility_name)
proposals_list = await pass_service.get_proposals_allocated_by_cycle(
cycle.name, facility=facility_name
)
for proposal in proposals_list:
await updated_cycle.update(
AddToSet({Cycle.proposals: str(proposal.Proposal_ID)})
Expand Down

0 comments on commit 963f6d4

Please sign in to comment.