mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] throw exception when no toke is available
This commit is contained in:
parent
433d8bc67c
commit
7261f5f479
@ -193,6 +193,8 @@ class runbot_repo(osv.osv):
|
|||||||
def github(self, cr, uid, ids, url, payload=None, delete=False, context=None):
|
def github(self, cr, uid, ids, url, payload=None, delete=False, context=None):
|
||||||
"""Return a http request to be sent to github"""
|
"""Return a http request to be sent to github"""
|
||||||
for repo in self.browse(cr, uid, ids, context=context):
|
for repo in self.browse(cr, uid, ids, context=context):
|
||||||
|
if not repo.token:
|
||||||
|
raise Exception('Repository does not have a token to authenticate')
|
||||||
match_object = re.search('([^/]+)/([^/]+)/([^/]+)', repo.base)
|
match_object = re.search('([^/]+)/([^/]+)/([^/]+)', repo.base)
|
||||||
if match_object:
|
if match_object:
|
||||||
url = url.replace(':owner', match_object.group(2))
|
url = url.replace(':owner', match_object.group(2))
|
||||||
|
Loading…
Reference in New Issue
Block a user