comparison src/server/blog.py @ 829:c1000ea40e6c

server (blog): fixed unicode handling for query args
author Goffi <goffi@goffi.org>
date Sat, 09 Jan 2016 12:59:07 +0100
parents 0c824ebe9d87
children a825700c01e4
comparison
equal deleted inserted replaced
828:0c824ebe9d87 829:c1000ea40e6c
240 request.extra_dict['rsm_max'] = unicode(C.STATIC_RSM_MAX_DEFAULT) 240 request.extra_dict['rsm_max'] = unicode(C.STATIC_RSM_MAX_DEFAULT)
241 try: 241 try:
242 request.extra_dict['rsm_index'] = request.args['index'][0] 242 request.extra_dict['rsm_index'] = request.args['index'][0]
243 except (ValueError, KeyError): 243 except (ValueError, KeyError):
244 try: 244 try:
245 request.extra_dict['rsm_before'] = request.args['before'][0] 245 request.extra_dict['rsm_before'] = request.args['before'][0].decode('utf-8')
246 except KeyError: 246 except KeyError:
247 try: 247 try:
248 request.extra_dict['rsm_after'] = request.args['after'][0] 248 request.extra_dict['rsm_after'] = request.args['after'][0].decode('utf-8')
249 except KeyError: 249 except KeyError:
250 pass 250 pass
251 251
252 def parseURLParamsCommentsRSM(self, request): 252 def parseURLParamsCommentsRSM(self, request):
253 """Parse RSM request data from the URL parameters for comments 253 """Parse RSM request data from the URL parameters for comments
278 # when display_single is set (because it then use item_ids which 278 # when display_single is set (because it then use item_ids which
279 # can't be used with MAM), but it is still used in this case 279 # can't be used with MAM), but it is still used in this case
280 # for navigation links. 280 # for navigation links.
281 request.mam_extra = {} 281 request.mam_extra = {}
282 try: 282 try:
283 request.mam_extra['mam_filter_{}'.format(C.MAM_FILTER_CATEGORY)] = request.args['tag'][0] 283 request.mam_extra['mam_filter_{}'.format(C.MAM_FILTER_CATEGORY)] = request.args['tag'][0].decode('utf-8')
284 except KeyError: 284 except KeyError:
285 pass 285 pass
286 286
287 ## Items retrieval 287 ## Items retrieval
288 288