Update the rules for which events get shown where to match expectations #2425
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2407
Description
The list of events we return for any given site is now updated to take in not only events whose location matches the site, but also any events belonging to partners on the site, even if they are happening outside the site's boundaries, and even if they have no address. I've updated the event resolver to support the import of address-less events.
I've also changed how we match events. We now take tags into consideration when we make the first query (some bits of the code were not doing this before leading to some inconsistencies on date filtering) and for tagged events, we specifically check for a partner match on name and address, against a list of approved partners.
I've written a mammoth test to support this, and updated lots of others to reflect the changes in logic.