[ckan-dev] Exception with display_name?

Ross Jones ross at mailbolt.com
Mon Aug 6 08:31:41 UTC 2018


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> On Behalf Of Christoph Blank
Sent: 06 August 2018 07:55
To: 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

 

 

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


More information about the ckan-dev mailing list