From 79a5a45ba0dfc91ab7239f32628fceec0b6412b3 Mon Sep 17 00:00:00 2001 From: Brian Bonnlander Date: Thu, 2 Jun 2022 23:30:08 +0000 Subject: [PATCH] make it possible to get email address --- .gitignore | 4 +++- ckanext/harvest/logic/action/get.py | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index df617f7..d01767a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,6 @@ development.ini node_modules *.project .eggs -.vscode/ \ No newline at end of file +.idea/ +.vscode/ + diff --git a/ckanext/harvest/logic/action/get.py b/ckanext/harvest/logic/action/get.py index 011dd66..c9c2df3 100644 --- a/ckanext/harvest/logic/action/get.py +++ b/ckanext/harvest/logic/action/get.py @@ -450,9 +450,13 @@ def harvest_get_notifications_recipients(context, data_dict): 'capacity': 'admin' }) + # Get access to email address by running action as admin user + context['user'] = 'admin' for member in members: - member_details = p.toolkit.get_action( - 'user_show')(context, {'id': member[0]}) + member_details = p.toolkit.get_action('user_show')(context, { + 'id': member[0], + 'include_plugin_extras': True + }) if member_details.get('email', None): recipients.append({