Mike-Heneghan / ALISS

ALISS (A Local Information System for Scotland) is a service to help you find help and support close to you when you need it most.
https://aliss.org
0 stars 0 forks source link

Look into email errors #117

Closed Mike-Heneghan closed 4 years ago

Mike-Heneghan commented 4 years ago

Internal Server Error: /services/email/

ImproperlyConfigured at /services/email/ TemplateResponseMixin requires either a definition of ‘template_name’ or an implementation of ‘get_template_names()’

Mike-Heneghan commented 4 years ago

Recreated an error by trying to email a service with an improperly formatted address i.e.

Screenshot 2019-10-24 at 19 12 27
Mike-Heneghan commented 4 years ago

https://docs.djangoproject.com/en/1.11/ref/forms/fields/#emailfield

Mike-Heneghan commented 4 years ago

Also, trigger the crash by hitting send with a blank email field.

Need to handle the 'required' and 'invalid' errors.

Mike-Heneghan commented 4 years ago

Added a form_invalid method to the service email form to catch when a submitted email is invalid, redirect back to the service detail page and then display a message that the email was not successfully added. It would be desirable to make the message more obvious potentially by changing the background colour.

I think there might be a better way to display errors on the field although I couldn't find it.

Mike-Heneghan commented 4 years ago
Screenshot 2019-10-25 at 12 11 20 Screenshot 2019-10-25 at 12 11 45
Mike-Heneghan commented 4 years ago

Merged into master