Merge lp:~dholbach/harvest/980657 into lp:harvest

Proposed by Daniel Holbach
Status: Merged
Merged at revision: 335
Proposed branch: lp:~dholbach/harvest/980657
Merge into: lp:harvest
Diff against target: 12 lines (+2/-0)
1 file modified
harvest/services/__init__.py (+2/-0)
To merge this branch: bzr merge lp:~dholbach/harvest/980657
Reviewer Review Type Date Requested Status
Dylan McCall Approve
Review via email: mp+101891@code.launchpad.net

Description of the change

only return valid opportunities

To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

Can anyone help with reviewing these? :)

Revision history for this message
Dylan McCall (dylanmccall) wrote :

Is there a way to do this that doesn't use the object_name property? It bothers me a tiny bit because it's undocumented.

Not a big deal, though. It does do the job :)

Revision history for this message
Daniel Holbach (dholbach) wrote :

Hm, I tried around a bit, but couldn't find a better way to do it. Do you have a suggestion?

Revision history for this message
Dylan McCall (dylanmccall) wrote :

Yeah, I couldn't find anything either. Looks like this is fairly common, so I doubt Django will surprise us here.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'harvest/services/__init__.py'
--- harvest/services/__init__.py 2012-04-11 16:47:39 +0000
+++ harvest/services/__init__.py 2012-04-13 10:47:20 +0000
@@ -75,6 +75,8 @@
75 if exclude is not None:75 if exclude is not None:
76 search_fields = [f for f in search_fields if f not in exclude]76 search_fields = [f for f in search_fields if f not in exclude]
77 search_values = dict([(str(key), value) for (key, value) in request.items()])77 search_values = dict([(str(key), value) for (key, value) in request.items()])
78 if model._meta.object_name == 'Opportunity':
79 search_values['valid'] = True
7880
79 extra_arguments = {}81 extra_arguments = {}
80 for key in search_values.keys():82 for key in search_values.keys():

Subscribers

People subscribed via source and target branches

to all changes: