-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
make external permissioned user creation case insensitive #3196
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -103,17 +103,6 @@ def list_users( | |||
return db_session.scalars(stmt).unique().all() | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved this down to be closer to other logic
@@ -128,7 +117,7 @@ def fetch_user_by_id(db_session: Session, user_id: UUID) -> User | None: | |||
return db_session.query(User).filter(User.id == user_id).first() # type: ignore | |||
|
|||
|
|||
def _generate_non_web_slack_user(email: str) -> User: | |||
def _generate_slack_user(email: str) -> User: | |||
fastapi_users_pw_helper = PasswordHelper() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var name changes
def _get_users_by_emails( | ||
db_session: Session, lower_emails: list[str] | ||
) -> tuple[list[User], list[str]]: | ||
stmt = select(User).filter(func.lower(User.email).in_(lower_emails)) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was main change: we now do a case insensitive user search and a case insensitive check for missing user emails.
I believe this is what caused admins to be set to externally permissioned users as this is the only place in the code where role is set to UserRole.EXT_PERM_USER. the failure case was there was a case mismatch for user upserting so now there are 2 users in the db with different roles. im looking into creating an alembic upgrade to fix it
replaced by: |
Description
^
Mental Checklist:
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.