Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
convert decimal to str when querying ES to try to fix traceback (bug …
Browse files Browse the repository at this point in the history
…770037)
  • Loading branch information
ngokevin committed Aug 14, 2012
1 parent d884435 commit e554a47
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion mkt/stats/tasks.py
@@ -1,4 +1,5 @@
from collections import defaultdict
import copy

from celeryutils import task
import commonware.log
Expand Down Expand Up @@ -354,4 +355,14 @@ def already_indexed(model, data):
except AttributeError:
pass

return list(model.search().filter(**data).values_dict(data.keys()[0]))
filter_data = copy.deepcopy(data)

# Search floating point number with string (bug 770037 fix attempt #100).
if 'revenue' in filter_data:
try:
filter_data['revenue'] = str(filter_data['revenue'])
except AttributeError:
pass

return list(model.search().filter(**filter_data)
.values_dict(data.keys()[0]))

0 comments on commit e554a47

Please sign in to comment.