##// END OF EJS Templates
webhook: fixed extra variable replacement.
marcink -
r2545:51dda326 stable
parent child Browse files
Show More
@@ -93,13 +93,14 b' class WebhookHandler(object):'
93 'username': data['actor']['username'],
93 'username': data['actor']['username'],
94 'user_id': data['actor']['user_id']
94 'user_id': data['actor']['user_id']
95 }
95 }
96
96 extra_vars = {}
97 extra_vars = {}
97 for extra_key, extra_val in data['repo']['extra_fields'].items():
98 for extra_key, extra_val in data['repo']['extra_fields'].items():
98 extra_vars['extra:{}'.format(extra_key)] = extra_val
99 extra_vars['extra__{}'.format(extra_key)] = extra_val
99 common_vars.update(extra_vars)
100 common_vars.update(extra_vars)
100
101
101 return string.Template(
102 template_url = self.template_url.replace('${extra:', '${extra__')
102 self.template_url).safe_substitute(**common_vars)
103 return string.Template(template_url).safe_substitute(**common_vars)
103
104
104 def repo_push_event_handler(self, event, data):
105 def repo_push_event_handler(self, event, data):
105 url = self.get_base_parsed_template(data)
106 url = self.get_base_parsed_template(data)
General Comments 0
You need to be logged in to leave comments. Login now