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 #27113

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

surbhi-posthog
Copy link
Contributor

@surbhi-posthog surbhi-posthog commented Dec 20, 2024

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 changed the title [feat][1/n][onboarding_exp] user model changes feat: [1/n][onboarding_exp] user model changes Dec 20, 2024
@surbhi-posthog surbhi-posthog changed the title feat: [1/n][onboarding_exp] user model changes feat: [1/n][role experiement] user model changes Dec 20, 2024
@zlwaterfield
Copy link
Contributor

@benjackwhite I know we don't want any postgresql migrations during the holiday - is this this add only, nullable field ok to go in today?

@surbhi-posthog surbhi-posthog marked this pull request as ready for review December 20, 2024 20:21
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.

2 participants