[Patchew-devel] [PATCH 1/5] git: include absolute link to log in REST result

Paolo Bonzini posted 4 patches 6 years, 7 months ago
There is a newer version of this series
[Patchew-devel] [PATCH 1/5] git: include absolute link to log in REST result
Posted by Paolo Bonzini 6 years, 7 months ago
Links in the REST API should be absolute.  The next patch will
centralize this in the Result object, in the meanwhile fix the
git plugin.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 mods/git.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mods/git.py b/mods/git.py
index 4fd7dbe..69b5da8 100644
--- a/mods/git.py
+++ b/mods/git.py
@@ -123,8 +123,8 @@ class GitModule(PatchewModule):
                 git_tag = message.get_property("git.tag")
                 data = {'repo': git_repo, 'tag': 'refs/tags/' + git_tag}
                 result = {'status': 'success', 'data': data}
-            result['log_url'] = reverse("git-log",
-                                        kwargs={'series': message.message_id})
+            log_url = reverse("git-log", kwargs={'series': message.message_id})
+            result['log_url'] = request.build_absolute_uri(log_url)
         else:
             result = {'status': 'pending'}
         results['git'] = result
-- 
2.16.2


_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel