carpentries / amy

A web-based workshop administration application built using Django.
https://amy.carpentries.org
MIT License
114 stars 72 forks source link

Errors in forms on test server #2426

Closed maneesha closed 1 year ago

maneesha commented 1 year ago

When filling out https://test-amy2.carpentries.org/forms/request_training/ we get the error:

AnymailRequestsAPIError at /forms/request_training/
Mailgun API response 401 (Unauthorized): 'Forbidden'

While the email should not go out, we should still be able to create forms in the test environment.

maneesha commented 1 year ago

This may be addressed in the new email automation project, because we will have ways to test emails.

maneesha commented 1 year ago

@pbanaszkiewicz We are adding this to the emails project as you are testing out how to send emails from the test server.

maneesha commented 1 year ago

@pbanaszkiewicz @elichad I would like to see if we can address this error sooner than the release of automated emails features.

One of our next projects is validating member codes on the instructor training application and the workshop request forms. We will need to be able to successfully submit test forms in order to do user testing for these features. I'm ok with a temporary fix, but we do need to be able to conduct user testing.

pbanaszkiewicz commented 1 year ago

@maneesha My initial idea is that this is caused by us using fake keys for Mailgun, instead of turning off the feature that sends the emails upon submitting the form. I'll check if we can have sandbox-like keys for the test server, and if not then I'll conditionally disable the email sending for the forms that use it.

pbanaszkiewicz commented 1 year ago

@maneesha It's ready for your testing!

maneesha commented 1 year ago

@pbanaszkiewicz I am opening this issue back up as I successfully submitted an instructor training application but get an error with the workshop form:

AnymailRequestsAPIError at /forms/request_workshop/
Mailgun API response 401 (Unauthorized): 'Forbidden'
Request Method: POST
Request URL:    http://test-amy2.carpentries.org/forms/request_workshop/
Django Version: 3.2.20
Exception Type: AnymailRequestsAPIError
Exception Value:    
Mailgun API response 401 (Unauthorized): 'Forbidden'
Exception Location: /venv/amy/lib/python3.11/site-packages/anymail/backends/base_requests.py, line 91, in raise_for_status
Python Executable:  /venv/amy/bin/python
Python Version: 3.11.4
Python Path:    
['/app',
 '/venv/amy/bin',
 '/usr/local/lib/python311.zip',
 '/usr/local/lib/python3.11',
 '/usr/local/lib/python3.11/lib-dynload',
 '/venv/amy/lib/python3.11/site-packages',
 '/app/amy']
Server time:    Tue, 29 Aug 2023 15:02:41 +0000
elichad commented 1 year ago

This has been fixed (see discussion in #2534)