ubccr / coldfront

HPC Resource Allocation System
https://coldfront.readthedocs.io
GNU General Public License v3.0
96 stars 76 forks source link

Bug: User Upgrade Account Issue #599

Open culbert opened 4 months ago

culbert commented 4 months ago

What happened?

When one of our users requested an account upgrade, the underlying mail function returned an error. I expected an email to be successfully sent to our help desk.

The issue is that in core/user/views.py in the UserUpgradeAccount object's post method, the from argument used in the call to the send_email_template function specifies request.user.email. This is the email for the user requesting the upgrade. Unless the gateway used to send email is authorized to send mail for the request.user.email domain then the mail will fail to send.

You appear to handle this at other points in the code base by using the setting "EMAIL_SENDER" when sending email. I believe the same approach should be used here.

I'm patching around this issue in my production context with the attached patch.

view.patch.txt

Version

1.1.5

Component

Users

What browsers are you seeing the problem on?

Firefox

Relevant log output

No response

Tasks/ user tests when bug is fixed

dsajdak commented 1 month ago

@culbert thanks for reporting this. It's not something we've hit before but can definitely fix.