diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2009-10-22 17:46:46 -0400 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2009-10-22 17:46:46 -0400 |
commit | 7bcba313da27b7230b14a7ea41d50e76cd03e9a5 (patch) | |
tree | 8c3e243f5f0311cef37ed8d7ee790f9a15efcc01 /apps/patchwork/views | |
parent | 799c2a2ac4e1d5b1fa5c02917551e18e1dc7aaaa (diff) | |
download | patchwork-7bcba313da27b7230b14a7ea41d50e76cd03e9a5.tar.bz2 patchwork-7bcba313da27b7230b14a7ea41d50e76cd03e9a5.tar.xz |
pwclient,xmlrpc: Specify project for patch hash lookups
We may see the same hash for two patches if one is sent to two lists
tracked by patchwork.
This change adds a new xmlrpc method, patch_get_by_project_hash, which
adds the linkname parameter to the lookup. We need to add a new method
instead of replacing patch_get_by_hash, to avoid breaking existing
pwclient apps.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/views')
-rw-r--r-- | apps/patchwork/views/xmlrpc.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/patchwork/views/xmlrpc.py b/apps/patchwork/views/xmlrpc.py index f322e53..23e58bf 100644 --- a/apps/patchwork/views/xmlrpc.py +++ b/apps/patchwork/views/xmlrpc.py @@ -355,6 +355,16 @@ def patch_get_by_hash(hash): return {} @xmlrpc_method(False) +def patch_get_by_project_hash(project, hash): + """Return structure for the given patch hash.""" + try: + patch = Patch.objects.filter(project__linkname = project, + hash = hash)[0] + return patch_to_dict(patch) + except: + return {} + +@xmlrpc_method(False) def patch_get_mbox(patch_id): """Return mbox string for the given patch ID.""" try: |