-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add support for using LTI data to populate user profile #324
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
base: mitx/teak
Are you sure you want to change the base?
feat: Add support for using LTI data to populate user profile #324
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: lms/djangoapps/lti_provider/users.py
Did you find this useful? React with a 👍 or 👎 |
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.
Summary of Changes
Hello @xitij2000, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly upgrades the LTI provider's capability to manage user accounts by enabling the use of personal information transmitted via LTI launches. Instead of defaulting to anonymous user creation, the system can now be configured to automatically populate user profiles with details like email and full name, streamlining the user onboarding process and providing a more complete user experience for LTI-integrated platforms.
Highlights
- New LTI PII Setting: Introduced a new
use_lti_pii
boolean field in theLtiConsumer
model, allowing administrators to configure whether personal identifiable information (PII) from LTI launches should be used to create user accounts. - Enhanced User Profile Population: The LTI provider can now utilize LTI launch parameters such as email (
lis_person_contact_email_primary
), full name (lis_person_name_full
), given name (lis_person_name_given
), and family name (lis_person_name_family
) to populate user profiles (email, full name, and username) during account creation or linking. - Improved User Creation Logic: Refactored the
create_lti_user
function to accept aprofile
dictionary, enabling more flexible and data-driven user creation. This includes handling cases where usernames might be missing or duplicate, ensuring unique usernames are generated. - Test Coverage Expansion: Added extensive new test cases using
ddt
(data-driven testing) to cover various scenarios for user creation with LTI PII, ensuring the robustness of the new functionality.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request introduces a valuable feature to populate user profiles using data from LTI launches, controlled by a new use_lti_pii
setting. The implementation is well-structured, with logic correctly refactored into helper functions and existing functions updated to handle the new profile data. The changes are robust, covering scenarios like pre-existing users and duplicate usernames. The accompanying tests are comprehensive and cover the new functionality well. I have one minor suggestion to clean up a duplicated test case.
3d8e210
to
a74614d
Compare
16091f9
to
4b6df42
Compare
@xitij2000 can you resolve the conflicts with this PR? |
Currently the LTI provider implementation auto-creates a random user when logging in, however, the LTI launch can include relevant user details such as their email, full name and even a username. This change makes the LTI code use the provided details if the "Use lti pii" setting is set in the Django admin. (cherry picked from commit 0bed7d7)
a74614d
to
dc60e55
Compare
Done |
4b6df42
to
ec79885
Compare
Description
Currently the LTI provider implementation auto-creates a random user when logging in, however, the LTI launch can include relevant user details such as their email, full name and even a username. This change makes the LTI code use the provided details if the "Use lti pii" setting is set in the Django admin.
Cherry Pick openedx#37307