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

Merged
merged 7 commits into from
Jan 6, 2025

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 marked this pull request as ready for review January 6, 2025 21:33
@surbhi-posthog surbhi-posthog requested review from zlwaterfield and raquelmsmith and removed request for zlwaterfield January 6, 2025 21:33
@surbhi-posthog surbhi-posthog requested review from benjackwhite and a team January 6, 2025 21:36
@surbhi-posthog surbhi-posthog merged commit 6f72c02 into master Jan 6, 2025
94 checks passed
@surbhi-posthog surbhi-posthog deleted the onboarding_model branch January 6, 2025 22:27
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