[FIX] runbot: skip github API calls if repo has no token, instead of crashing/logging an exception

Avoids spurious errors for the github status updates
This commit is contained in:
Olivier Dony 2015-04-23 10:35:12 +02:00
parent e0103ed3f0
commit 7137c49ec5

View File

@ -225,6 +225,8 @@ class runbot_repo(osv.osv):
def github(self, cr, uid, ids, url, payload=None, ignore_errors=False, context=None):
"""Return a http request to be sent to github"""
for repo in self.browse(cr, uid, ids, context=context):
if not repo.token:
return
try:
match_object = re.search('([^/]+)/([^/]+)/([^/.]+(.git)?)', repo.base)
if match_object: