diff --git a/annotator/annotation.py b/annotator/annotation.py index c446322..58eb963 100644 --- a/annotator/annotation.py +++ b/annotator/annotation.py @@ -95,13 +95,14 @@ def search_raw(cls, query=None, params=None, raw_result=False, def _build_query(cls, query=None, offset=None, limit=None, sort=None, order=None): if query is None: query = {} + else: + query = dict(query) # shallow copy # Pop 'before' and 'after' parameters out of the query - copied_query = dict(query) - after = copied_query.pop('after', None) - before = copied_query.pop('before', None) + after = query.pop('after', None) + before = query.pop('before', None) - q = super(Annotation, cls)._build_query(copied_query, offset, limit, sort, order) + q = super(Annotation, cls)._build_query(query, offset, limit, sort, order) # Create range query from before and/or after if before is not None or after is not None: