[ckan-dev] Exception with display_name?

Christoph Blank cb at unused.at
Mon Aug 6 15:44:31 UTC 2018


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> wrote:

> Hi
>
>
>
> The display_name for groups/organizations is set at
> https://github.com/ckan/ckan/blob/d7efea1d0e2729b22dd8377d3fcc91
> 77ae69853b/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/62961124/attachment-0002.html>


More information about the ckan-dev mailing list