ckan / ckanext-harvest

Remote harvesting extension for CKAN
130 stars 203 forks source link

add recipient only if there is email #510

Closed FuhuXia closed 2 years ago

FuhuXia commented 2 years ago

This change add sysadmin to the recipient only if the sysadmin account has a non-empty email address.

This fixes the following issue: CKAN core creates a sysadmin account using site_id as name, None as email in code https://github.com/ckan/ckan/blob/master/ckan/logic/action/get.py#L2428-L2433, therefore we were sending a None as email address down the line and eventually the mailer will generate an error.

python/lib/python3.7/smtplib.py", line 153, in quoteaddr                                        
if addrstring.strip().startswith('<'):                                                                                  
AttributeError: 'NoneType' object has no attribute 'strip'