On 2013-07-17 11:14, Nigel Legg wrote: > def on_interaction(self, consumer, interaction, hash): ... > result.sm_Link = interaction['interaction']['link'] ... > Looking at the server log (development server) I get > result.sm_Link = interaction['interaction']['link'] > KeyError: 'link' > > Is this a reserved name problem, or have I made another error?
It means that if you look at what's returned by interaction['interaction'] it doesn't contain a key named "link" for you to access. It's an issue with your data. If it's user-sourced or 3rd-party-sourced data, you need to test for the case and make sure that you handle it in a way appropriate to your app ("hey, ninny, you sent a malformed document" or "hey, our data-provider is a dim bulb"; or this missing information might be entirely normal, so handle that case). If you sent it to them and they sent it back tampered, you might want to sign it and then yell at them if they tamper with bits they shouldn't. And treat all my dope-slapping terms as bad UX, adjusting accordingly :-) -tkc -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.