Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
Another optimization for /api/importSourceLocations, refs #646
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jun 9, 2021
1 parent d90d512 commit 89cf550
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vaccinate/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,10 @@ def import_source_locations(request, on_request_logged):
)

if matched_location is not None:
new_concordances = source_location.concordances.difference(
matched_location.concordances.all()
new_concordances = list(
source_location.concordances.values_list(
"pk", flat=True
).difference(matched_location.concordances.all())
)
matched_location.concordances.add(*new_concordances)

Expand Down

0 comments on commit 89cf550

Please sign in to comment.