Skip to content

Conversation

@rohangpta
Copy link
Member

@rohangpta rohangpta commented Sep 21, 2022

Previously, emails would only be set on first login. Update this on every login to prevent the default case of @upenn.edu emails persisting.

@codecov
Copy link

codecov bot commented Sep 21, 2022

Codecov Report

Base: 97.60% // Head: 97.61% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (742071e) compared to base (8545148).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #137      +/-   ##
==========================================
+ Coverage   97.60%   97.61%   +0.01%     
==========================================
  Files          15       15              
  Lines         709      714       +5     
==========================================
+ Hits          692      697       +5     
  Misses         17       17              
Flag Coverage Δ
backend 97.61% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
backend/accounts/backends.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rohangpta
Copy link
Member Author

@joyliu-q bumping this

Copy link
Contributor

@joyliu-q joyliu-q left a comment

Choose a reason for hiding this comment

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

LGTM!

@joyliu-q joyliu-q merged commit 82e9731 into master Sep 26, 2022
@joyliu-q joyliu-q deleted the email-fixes branch September 26, 2022 15:33
@ArmaanT
Copy link
Member

ArmaanT commented Sep 26, 2022

Isn't this what the account management system exists for? This PR also clobbers any changes people make to their primary email in that system.

@rohangpta
Copy link
Member Author

rohangpta commented Sep 26, 2022

Isn't this what the account management system exists for? This PR also clobbers any changes people make to their primary email in that system.

Do you have a link to what you're talking about? From what I could see emails were set only on first login and never after. After this is merged, emails are updated on every login.

The reason we are doing this is because the @upenn.edu emails bounce (problem for Penn Clubs). I might be mistaken though, haven't really looked around the platform code.

RE: primary emails, I think it's ok to enforce primary email to be what Penn gives us. If anyone has a problem with their email, they can take it up with Penn.

@ArmaanT
Copy link
Member

ArmaanT commented Sep 26, 2022

@rohangpta
Copy link
Member Author

Can you explain how what I am doing is redundant or not needed? I know that platform exists. From what I can see the previous code would only set emails on first login.

@ArmaanT
Copy link
Member

ArmaanT commented Sep 26, 2022

Right, the code you modified is the part of platform that generates an initial django user object based on the data we get from shibboleth for a user. The entire point of the account management system was to give a way for students to modify that data. They can set a preferred first name to show up on our products rather than the one Penn gives us as well as add and verify email addresses and phone numbers so that way our other products can use that list from platform and not worry about doing their own validation.

@rohangpta
Copy link
Member Author

rohangpta commented Sep 26, 2022

I see what you mean here, but I still think we should stick with this email setting mechanism.

If we don't have this logic, one the one hand, for those students that do not have emails on the ISC API at the time of creation, we'll never (eventually) have their correct emails. (there are actually a lot of these students -- see #clubs and #platform)

On the other hand, we'll always override someone's custom primary email -- this is a niche use case anyways. I think we can just go with the former and have people take it up with the Penn directory if they want their public facing email changed.

@ArmaanT
Copy link
Member

ArmaanT commented Sep 26, 2022

It's certainly your decision to make, but "we'll never (eventually) have their correct emails" doesn't have to be the case. You can always point students to the account management system and tell them to add whatever email they want. There was also a plan to modify DLA so that it would be easier for products (like clubs) to have their own edit contact pages which send the correct requests to platform so that platform is always updated.

@rohangpta
Copy link
Member Author

That's definitely something we can do -- and we'll update this script if that ends up happening. I'll add it in a backlog somewhere. For now, just to be future proof and avoid having to backfill again, we'll stick with this.

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.

4 participants