Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Fix account join issue #1055

Merged
merged 1 commit into from
May 2, 2018
Merged

Conversation

tabletcorry
Copy link
Contributor

@tabletcorry tabletcorry commented May 2, 2018

Introduced (partially) in #872. You can't filter on a table that hasn't
been properly joined.

This issue causes the active filter to return 1/N results, where N is the number of active accounts.

Also, you can't join the same table several times, so the existing code
would have also broken if account and accounttype were filtered at the
same time.

So, pull the join out, and invoke it when anyone needs it.

Introduced (partially) in Netflix#872. You can't filter on a table that hasn't
been properly joined.

Also, you can't join the same table several times, so the existing code
would have also broken if account and accounttype were filtered at the
same time.

So, pull the join out, and invoke it when anyone needs it.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.006%) to 72.427% when pulling e4be801 on tabletcorry:account_join_fix into adfe606 on Netflix:develop.

@@ -247,6 +248,7 @@ def get(self):
if 'active' in args:
active = args['active'].lower() == "true"
query = query.filter(ItemRevision.active == active)
join_accounts = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't previously have query = query.join((Account, Account.id == Item.account_id)). Is this supposed to be here also?

Copy link
Contributor Author

@tabletcorry tabletcorry May 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The active filter not working properly is what caused me to notice this. I then fixed the other bugs I saw due to the same root issue.

@mikegrima mikegrima merged commit a282e5d into Netflix:develop May 2, 2018
@tabletcorry tabletcorry deleted the account_join_fix branch May 2, 2018 22:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants