From 471bea5ddafd21539c07f93c73d8466f26a7e7b1 Mon Sep 17 00:00:00 2001 From: amercader Date: Wed, 4 Jan 2017 11:43:09 +0000 Subject: [PATCH] [#3378] Change order of debug statement Otherwise if there is a unicode error it won't get caught before decoding --- ckan/views/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckan/views/__init__.py b/ckan/views/__init__.py index be15f4709d3..154e52ef254 100644 --- a/ckan/views/__init__.py +++ b/ckan/views/__init__.py @@ -173,8 +173,8 @@ def _get_user_for_apikey(): apikey = u'' if not apikey: return None - log.debug(u'Received API Key: %s' % apikey) apikey = apikey.decode('utf8', 'ignore') + log.debug(u'Received API Key: %s' % apikey) query = model.Session.query(model.User) user = query.filter_by(apikey=apikey).first() return user