allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [16/23] allura git commit: [#4542] ticket:728 Use admin_url in Webhook.url()
Date Mon, 16 Feb 2015 21:16:06 GMT
[#4542] ticket:728 Use admin_url in Webhook.url()


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a22f6f62
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a22f6f62
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a22f6f62

Branch: refs/heads/master
Commit: a22f6f62282bb3052746870541e79ff1da37772c
Parents: 289eed1
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Feb 13 13:14:01 2015 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Mon Feb 16 10:17:41 2015 +0000

----------------------------------------------------------------------
 Allura/allura/app.py           | 2 +-
 Allura/allura/model/webhook.py | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/a22f6f62/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 388b8a2..5a6db3e 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -287,7 +287,7 @@ class Application(object):
     @LazyProperty
     def admin_url(self):
         return '{}{}/{}/'.format(
-            c.project.url(), 'admin',
+            self.project.url(), 'admin',
             self.config.options.mount_point)
 
     @property

http://git-wip-us.apache.org/repos/asf/allura/blob/a22f6f62/Allura/allura/model/webhook.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/webhook.py b/Allura/allura/model/webhook.py
index 4c39309..563f871 100644
--- a/Allura/allura/model/webhook.py
+++ b/Allura/allura/model/webhook.py
@@ -36,10 +36,9 @@ class Webhook(Artifact):
     last_sent = FieldProperty(dt.datetime, if_missing=None)
 
     def url(self):
-        return '{}{}/{}/webhooks/{}/{}'.format(
-            self.app_config.project.url(), 'admin',
-            self.app_config.options.mount_point,
-            self.type, self._id)
+        app = self.app_config.load()
+        app = app(self.app_config.project, self.app_config)
+        return '{}webhooks/{}/{}'.format(app.admin_url, self.type, self._id)
 
     def enforce_limit(self):
         '''Returns False if limit is reached, otherwise True'''


Mime
View raw message