-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: check for the organization id (#26515)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
240192d
commit 10add44
Showing
6 changed files
with
109 additions
and
26 deletions.
There are no files selected for viewing
Binary file modified
BIN
+91 Bytes
(100%)
frontend/__snapshots__/scenes-other-onboarding--onboarding-billing--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
from posthog.models.organization import OrganizationMembership | ||
from posthog.models.team.team import Team | ||
from posthog.models.user import User | ||
from posthog.models.organization import Organization | ||
from posthog.rbac.user_access_control import UserAccessControl | ||
from posthog.test.base import BaseTest | ||
|
||
|
@@ -78,6 +79,23 @@ def test_no_organization_id_passed(self): | |
assert user_access_control._organization is None | ||
assert user_access_control._user_role_ids == [] | ||
|
||
def test_organization_with_no_project_or_team(self): | ||
organization = Organization.objects.create(name="No project or team") | ||
user = User.objects.create_and_join(organization, "[email protected]", "testtest") | ||
user_access_control = UserAccessControl(user, organization_id=organization.id) | ||
|
||
assert user_access_control._organization_membership is not None | ||
assert user_access_control._organization == organization | ||
|
||
def test_organization_with_no_project_or_team_and_no_organization_id(self): | ||
organization = Organization.objects.create(name="No project or team") | ||
user = User.objects.create_and_join(organization, "[email protected]", "testtest") | ||
user_access_control = UserAccessControl(user) | ||
|
||
assert user_access_control._organization_membership is None | ||
assert user_access_control._organization is None | ||
assert user_access_control._user_role_ids == [] | ||
|
||
def test_without_available_product_features(self): | ||
self.organization.available_product_features = [] | ||
self.organization.save() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters