Skip to content
This repository has been archived by the owner on Mar 22, 2020. It is now read-only.

Commit

Permalink
fix score hook api
Browse files Browse the repository at this point in the history
  • Loading branch information
reinbach committed Sep 29, 2013
1 parent 25d6561 commit 329720f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions worker/score_hooks/hook_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ def send_score(score_attrib_id, project_score_id, value):
"project_score": project_score_id,
"score_value": value,
}
r = requests.post("{0}project-score-attributes/".format(API_URL),
r = requests.put("{0}project-score-attributes/".format(API_URL),
data=payload, auth=AUTH)
logging.debug(r.text)


def run(project, result):
def score(project, result):
""" given a result, call the api with the results"""
project_score_id = project.get('project', {}).get('project_score_id', None)
if not project_score_id:
Expand All @@ -27,7 +27,7 @@ def run(project, result):
score_attrib_slug = result[0]
score_attrib = get_score_attribute(score_attrib_slug)
score_attrib_id = score_attrib.get('id', None)
value = result.get('value', None)
value = result[1]

if score_attrib_id and project_score_id and value:
send_score(score_attrib_id, project_score_id, value)
Expand Down

0 comments on commit 329720f

Please sign in to comment.