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

feat: [1/n][role experiement] user model changes #27190

Closed
wants to merge 6 commits into from

Conversation

surbhi-posthog
Copy link
Contributor

Problem

For experiment details please refer to : #26993

We previously did not have role in the user role in the user model. To expose role based changes in the UX, we need to add this to our User model

Changes

backend model changes

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

n/a

How did you test this code?

In python debugger:
created a new user with and without a role and made sure we can read them correctly:
from posthog.models import User

# 1. Create user with role
user_with_role = User.objects.create_user(
    email="[email protected]",
    password="testpassword123",
    first_name="Test",
    role_at_organization="engineering"
)
print(f"User with role: {user_with_role.email}, Role: {user_with_role.role_at_organization}")

# 2. Create user without role
user_without_role = User.objects.create_user(
    email="[email protected]",
    password="testpassword123",
    first_name="Test"
)
print(f"User without role: {user_without_role.email}, Role: {user_without_role.role_at_organization}")

@surbhi-posthog surbhi-posthog requested review from benjackwhite and a team December 30, 2024 19:44
@surbhi-posthog surbhi-posthog marked this pull request as ready for review December 30, 2024 19:44
@surbhi-posthog
Copy link
Contributor Author

having merge issues on this branch related to the max model file. I'm moving these changes here

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