Skip to content

LTI teacher email input support#54972

Merged
daynew merged 2 commits into
staging-nextfrom
p20-556-lti-teacher-email-input
Dec 7, 2023
Merged

LTI teacher email input support#54972
daynew merged 2 commits into
staging-nextfrom
p20-556-lti-teacher-email-input

Conversation

@daynew

@daynew daynew commented Nov 15, 2023

Copy link
Copy Markdown
Member

LTI doesn't guarantee to provide an Email when a teacher is signing up for a Code.org account. However, at Code.org, we want every Teacher account to have an email associated with it so we can reach out to them or find their User data if there are issues.

This PR adds an email input field to the account signup page if the LMS doesn't provide an email address and the user is a Teacher.

Links

Testing story

  • Unit tests
  • Manual test

@daynew daynew requested a review from a team November 15, 2023 23:13
@daynew daynew changed the title P20 556 lti teacher email input LTI teacher email input support Nov 15, 2023
Comment thread dashboard/lib/services/lti.rb Outdated
Comment thread dashboard/lib/policies/user.rb Outdated
@daynew daynew force-pushed the p20-556-lti-teacher-email-input branch from f52e4f5 to cedaca9 Compare December 7, 2023 01:39
@daynew daynew changed the base branch from staging to staging-next December 7, 2023 01:40
@daynew daynew requested a review from a team December 7, 2023 01:40
@daynew daynew marked this pull request as ready for review December 7, 2023 01:40
Comment on lines +13 to +23
# user.authentication_options is a nested attribute we expose on the form
# for creating new user accounts. This code looks for new authentication
# option values submitted by the user, such as email, and updates the User
# object.
# Since a User can have multiple AuthenticationOptions, the form code treats
# the nested attribute as an Array, however there should only every be one
# value when a new account is being created. Since the User and
# AuthenticationOptions haven't actually been created in the DB yet, there is
# no unique `id` attribute for the objects, so we will assume the index in the
# array is consistent between the `user.authentication_options` and form
# `params`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if this makes sense or if it is unnecessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the comment. Without it, the reasoning for these functions is pretty obscure.

@carl-codeorg carl-codeorg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One typo on a comment, otherwise LGTM!

Comment thread dashboard/lib/services/user.rb Outdated
# option values submitted by the user, such as email, and updates the User
# object.
# Since a User can have multiple AuthenticationOptions, the form code treats
# the nested attribute as an Array, however there should only every be one

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typo: every should be ever

Comment on lines +13 to +23
# user.authentication_options is a nested attribute we expose on the form
# for creating new user accounts. This code looks for new authentication
# option values submitted by the user, such as email, and updates the User
# object.
# Since a User can have multiple AuthenticationOptions, the form code treats
# the nested attribute as an Array, however there should only every be one
# value when a new account is being created. Since the User and
# AuthenticationOptions haven't actually been created in the DB yet, there is
# no unique `id` attribute for the objects, so we will assume the index in the
# array is consistent between the `user.authentication_options` and form
# `params`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the comment. Without it, the reasoning for these functions is pretty obscure.

@daynew daynew force-pushed the p20-556-lti-teacher-email-input branch from cedaca9 to f607363 Compare December 7, 2023 21:40
@daynew daynew merged commit c422784 into staging-next Dec 7, 2023
@daynew daynew deleted the p20-556-lti-teacher-email-input branch December 7, 2023 21:43
snickell pushed a commit that referenced this pull request Feb 3, 2024
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