[ckan-dev] Exception with display_name?

Kevin Brochet-Nguyen kevin at viderum.com
Tue Aug 7 08:56:52 UTC 2018


Hi Christoph,

CKAN 2.7 introduced some changes that break the plugin. There’s a branch of the plugin available on GitHub that contains fixes for 2.7. It might resolve the errors you’re seeing in 2.8.1. It hasn’t been merged into master yet because we need to add version checks so that it’s compatible with newer and older versions of CKAN.

To view on GitHub:
https://github.com/ViderumGlobal/ckanext-orgportals/tree/ckan2.7-fixes

For pip-installing:
https://github.com/ViderumGlobal/ckanext-orgportals@ckan2.7-fixes#egg=ckanext-orgportals

If you still see errors while using it with 2.8.1, please email me directly or follow up with the issue on the GitHub page so we can address the issue directly.

I’m sorry for the inconvenience. The general approach to the plugin ecosystem is also something we need to reconsider.

Kind regards,
Kevin

--
Kevin Brochet-Nguyen
Sofware Developer

Viderum – ein Unternehmen der Open Knowledge Foundation
http://www.viderum.de/  |  @videruminc

Viderum GmbH
Marchlewskistr. 101
10243 Berlin

Eingetragen beim Amtsgericht Charlottenburg, Registernummer HRB 176512 B
Geschäftsführer: Sebastian Moleski


On 7. August 2018 at 09:31:51, Christoph Blank (cb at unused.at<mailto:cb at unused.at>) wrote:

Hi Kevin,

Could you maybe ask the team which ckan version they use that works for them with orgportals?
I have tried to fix some of the errors, but keep getting more with 2.8.1

Thanks a lot!
Christoph

On Mon, Aug 6, 2018 at 5:57 PM, Kevin Brochet-Nguyen <kevin at viderum.com<mailto:kevin at viderum.com>> wrote:
ckanext-orgportals is one of our extensions—I haven’t worked on it myself, so I don’t have a quick diagnosis, but I’ll ask our team to look into it.

Are you using any other extensions? I remember that orgdashboards, which is a plugin that’s similar to orgportals, has some odd interactions with other extensions.

Kind regards,
Kevin

--
Kevin Brochet-Nguyen
Sofware Developer

Viderum – ein Unternehmen der Open Knowledge Foundation
http://www.viderum.de/  |  @videruminc

Viderum GmbH
Marchlewskistr. 101
10243 Berlin

Eingetragen beim Amtsgericht Charlottenburg, Registernummer HRB 176512 B
Geschäftsführer: Sebastian Moleski


On 6. August 2018 at 17:45:24, Christoph Blank (cb at unused.at<mailto:cb at unused.at>) wrote:

Hi Ross,

Thank you very much for helping out.

It's a docker installation, but I managed to log the organization var:

[{'approval_status': u'approved', 'image_display_url': u'', 'package_count': 1, 'title': u'Stadt Test', 'name': u'stadt-test', 'is_organization': True, 'state': u'active', 'image_url': u'', 'type': u'organization', 'num_followers': 0, 'id': u'ea259eda-05e8-443c-9fee-a823fc259aa5', 'description': u'test'}]
Error - <type 'exceptions.KeyError'>: 'display_name'
URL: http://localhost:5000/organization/edit/stadt-test

Any idea why display_name is missing here?

Thanks!
Christoph

On Mon, Aug 6, 2018 at 10:31 AM, Ross Jones <ross at mailbolt.com<mailto:ross at mailbolt.com>> wrote:
Hi

The display_name for groups/organizations is set at https://github.com/ckan/ckan/blob/d7efea1d0e2729b22dd8377d3fcc9177ae69853b/ckan/lib/dictization/model_dictize.py#L361 and was added 4 years ago. You’re using a recent-ish CKAN, right?

I can’t see anywhere in _group_or_org_list that removes that key, so the problem must be elsewhere.  Are you able to log the output of https://github.com/ViderumGlobal/ckanext-orgportals/blob/master/ckanext/orgportals/helpers.py#L349 to make sure that organizations is a list of dicts and each dict has a display_name (it could be that one, for some reason) doesn’t.

Totally randomly, can you ensure you don’t have an org without a name/title – I don’t think it’s a very common occurrence but I have a vague memory of it happening once.

Ross




From: ckan-dev <ckan-dev-bounces at lists.okfn.org<mailto:ckan-dev-bounces at lists.okfn.org>> On Behalf Of Christoph Blank
Sent: 06 August 2018 07:55
To: ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>
Subject: Re: [ckan-dev] Exception with display_name?

Can anyone help with the issue below? I'm stuck :(

Hi there,

I'm trying to setup ckan with docker-compose and am stuck with a particular extension.
I'm not sure if this issue is related to the extension itself, though.

I'm trying to use: https://github.com/ViderumGlobal/ckanext-orgportals

If I navigate to the organizations edit page, I get an internal server error:
https://gist.github.com/solars/33c6eed1cce6395dfa5be0531a5ab88b

Specifically:

File '/usr/lib/ckan/venv/src/ckanext-orgportals/ckanext/orgportals/helpers.py', line 354 in <lambda> 'text': item['display_name']
KeyError: 'display_name' The corresponding code seems to be this: https://github.com/ViderumGlobal/ckanext-orgportals/blob/master/ckanext/orgportals/helpers.py#L354
I'm not sure about the exact call, but does anyone familiar with the changes in ckan know if there was a change, i.e. the key was removed or similar?
Or can anyone tell me how to set this particular key? I couldn't find anything.

Thanks for your help!
Christoph




_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev

_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20180807/47964888/attachment-0002.html>


More information about the ckan-dev mailing list