[ckan-dev] Exception with display_name?

Kevin Brochet-Nguyen kevin at viderum.com
Mon Aug 6 15:57:41 UTC 2018


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
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/20180806/fc5fe6f6/attachment-0002.html>


More information about the ckan-dev mailing list