You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to send a test email once every student has been emailed #147
The email page starts with the To field holding only students who haven't been emailed yet. Once everyone has been emailed, To is empty. Because To is required, the browser blocks every button that submits the form, including Send test. Nothing tells staff why the click did nothing.
The server also refuses it. EmailForm.to_addr is InputRequired(), and the test-email path only runs after the whole form validates. So a test sent without JavaScript fails with "to_addr: This field is required."
To reproduce
Seat at least one student and email all students from the email page.
Go back to the email page (/students/email/). To is empty, with "Leaving out N students already emailed."
Pick a student under "Send a test", enter your address and click Send test.
Expected: the test email is sent to that address. It doesn't need anyone in To, since a test only goes to the test address.
Actual: nothing happens. The browser highlights the empty To field, and no message says why.
Workaround: click "Email them again too" to refill To, then send the test. You then have to be careful not to click "Send to students" afterwards.
Possible fix
Make To required only for the real send:
Server: check To in the send paths rather than in the form's validators. Those paths are email_all_students, email_students_batch and email_single_student.
Browser: take off To's required attribute and check it in the "Send to students" handler instead.
Activity
YashChainani28 commentedon Oct 28, 2026
working on this