Skip to content

Conversation

@GuySharir
Copy link

As described in this issue we want to avoid making extra queries when using related managers.

The proposed solution avoids making extra DB calls by comparing the tenant field of val against self.tenant_value instead of comparing val with the whole tenant object.

Notes

is_val_equal_to_tenant is a bit misleading/bad naming as this function actually checks for in-equality.

I think we should do one of the following-

  • Change the name to is_not_equal_to_tenant and keep the same implementation
  • Update the logic to check for equality, keep the current name and update the condition where this is used to be negated

I can update this PR if you prefer one of these options, I wanted to keep this PR on the issue point and avoid cosmetics so didn't add these changes in advance.

@GuySharir
Copy link
Author

@microsoft-github-policy-service agree company="Twingate"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant