IATI / ckanext-iati

CKAN extension for the IATI Registry
http://iatiregistry.org
9 stars 6 forks source link

URL errors email has literal strings `publisher_name` and `publisher_registry_dataset_link` insterted #410

Closed Bjwebb closed 9 months ago

Bjwebb commented 11 months ago

The URL errors email is broken, it is formatted with the literal strings publisher_name and publisher_registry_dataset_link instead of the relevant publisher name and dataset link.

Severity Medium/High

Issue Location This happens in this bit of code: https://github.com/IATI/ckanext-iati/blob/f433e3d1de8b7ee66759e5e9a7182e8a63f7b3bc/ckanext/iati/logic/validators.py#L27-L41

I'd guess this should be context['publisher_name'] etc. instead.

The text that is formatted can be found at https://github.com/IATI/ckanext-iati/blob/f433e3d1de8b7ee66759e5e9a7182e8a63f7b3bc/ckanext/iati/emailer.py#L113-L1251

Steps to Reproduce Add an invalid url to a dataset (e.g. badscheme://example.org/a.xml).

Expected Results/Behaviour The relevant relevant publisher name and dataset link are inserted into the message.

Actual Results/Behaviour The the literal strings publisher_name and publisher_registry_dataset_link are inserted in to the message.

Here's an example email that was received, with the user name redacted:

Dear [redacted],

You're receiving this email because you are the admin user of publisher_name's IATI Registry account. We've detected an issue with the following IATI dataset in your IATI Registry account: publisher_registry_dataset_link The dataset is not accessible. To fix the error, please update the dataset link (URL) in the IATI Registry.

Should you have any queries or support needs, then please email the IATI Helpdesk at: support@iatistandard.org Kind regards, IATI Technical Team

cormachallinanderilinx commented 10 months ago

@Bjwebb I created a PR: https://github.com/IATI/ckanext-iati/pull/415 think its worthwhile adding a link to the dataset that the updated was attempted on?