From 483ca702690b26cf0614d87da8daac8f6bafc9f3 Mon Sep 17 00:00:00 2001 From: Massimo Santini Date: Mon, 12 Dec 2011 16:34:15 +0100 Subject: [PATCH] Flattening pqrse_qs arrays --- nofussbm/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nofussbm/api.py b/nofussbm/api.py index 2867ae2..541343d 100644 --- a/nofussbm/api.py +++ b/nofussbm/api.py @@ -132,9 +132,9 @@ def get( bid = None ): limit = int( m[ 2 ] ) - skip + 1 if m[ 2 ] else 0 if not m or limit < 0: abort( 416 ) - args = parse_qs( request.headers[ 'X-Nofussbm-query' ] ) if 'X-Nofussbm-query' in request.headers else None - query = query_from_dict( g.email, args ) - + args = parse_qs( request.headers[ 'X-Nofussbm-Query' ] ) if 'X-Nofussbm-Query' in request.headers else None + query = query_from_dict( g.email, dict( ( k, args[ k ][ 0 ] ) for k in args.keys() ) ) + try: cur = g.db.bookmarks.find( query, skip = skip, limit = limit ) n = cur.count()