geopython / GeoHealthCheck

Service Status and QoS Checker for OGC Web Services
https://geohealthcheck.org
MIT License
84 stars 71 forks source link

Fix spaces for notify emails (issue #346) #350

Closed borrob closed 3 years ago

borrob commented 3 years ago

The input for the email address for the notification allows for multiply entries if they are separated by commas. When the form is displayed again, spaces are added after the commas. The extra spaces generate an error when the user tries to safe the edits.

This commit fixes:

borrob commented 3 years ago

Although the fix in the client looks ok, server-side handling should not depend on it. The server that handles the form should strip any whitespace around email addresses before storing. The current code does not seem to do this see app.py#L688. I think the code should be: [v.strip() for v in value] also on L691. I think this server-fix(es) can be added in addition to the client template fix here.

Good catch on the back end. I added the strip() commands to [v.strip() for v in value if v.strip()]. The latter v.strip() is still necessary since it will catch 'empty' (i.e. just spaces) values. This prevents errors when an email list is entered as a@mail.com, ,b@mail.com (notice the , , structure).

justb4 commented 3 years ago

Thanks @borrob !