Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to show Network Server Name column in Service Profile List. #570

Closed
wants to merge 1 commit into from
Closed

Fix to show Network Server Name column in Service Profile List. #570

wants to merge 1 commit into from

Conversation

sagar-patel-sls
Copy link
Contributor

Fix to show Network Server Name column in Service Profile List

image

@brocaar Please review my change

Thanks

Signed-off-by: SAGAR PATEL <sagar.a.patel@slscorp.com>
count(distinct sp.*)
from
service_profile sp
left join organization_user ou
inner join organization_user ou
Copy link
Owner

Choose a reason for hiding this comment

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

Is this correct? An organization user is optional, so I believe with an inner join, if no org. user exists, the service-profile is not counted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filter on user ID
when an organizationID is not set and the user is not a global admin then the organization user will add in query

brocaar added a commit that referenced this pull request Jan 29, 2021
@brocaar
Copy link
Owner

brocaar commented Feb 2, 2021

@sagar-patel-sls I believe the above commit (5cdc262) should fix the issue. I have also added an additional test (+ refactored the Go Convey based tests into testify based tests, as I want to move away from Go Convey).

Is this correct? An organization user is optional, so I believe with an inner join, if no org. user exists, the service-profile is not counted.

What I mean which this is that in this case there must be a match between organization and organization user. This could be valid when you only have a global admin user for example. By changing the left join into an inner join, both the organization and organization user must exist. In case of a left join, you will get null values when no organization user match is found, that should be the intended behavior I believe so that you don't eliminate organizations without org. users from the result set.

@brocaar brocaar closed this Feb 2, 2021
@sagar-patel-sls sagar-patel-sls deleted the service-profile-bug branch February 12, 2021 08:49
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.

None yet

2 participants