mirror of https://github.com/zulip/zulip.git
webhooks/gci: Replace 'type' -> 'event_type', 'uuid' -> 'id'.
This commit is contained in:
parent
839b427ea5
commit
9969a3a40b
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"author_is_student": true,
|
||||
"task_definition_name": "Sails unspread it stopped at kearney",
|
||||
"type": "comment",
|
||||
"event_type": "comment",
|
||||
"task_instance": 6296903092273152,
|
||||
"task_claimed_by": "student-yqqtag",
|
||||
"time": 1506475323.256627,
|
||||
"uuid": "1f4bab4d1820400f9b50ed8bf2bb03b3",
|
||||
"id": "1f4bab4d1820400f9b50ed8bf2bb03b3",
|
||||
"author": "student-yqqtag",
|
||||
"task_instance_url": "https://0.0.0.0:8000/dashboard/task-instances/6694926301528064/",
|
||||
"task_definition_url": "https://0.0.0.0:8000/dashboard/tasks/6694926301528064/"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"author_is_student": true,
|
||||
"task_definition_name": "Sails unspread it stopped at kearney",
|
||||
"type": "abandon",
|
||||
"event_type": "abandon",
|
||||
"task_instance": 6296903092273152,
|
||||
"task_claimed_by": "student-yqqtag",
|
||||
"time": 1506475323.256627,
|
||||
"uuid": "1f4bab4d1820400f9b50ed8bf2bb03b3",
|
||||
"id": "1f4bab4d1820400f9b50ed8bf2bb03b3",
|
||||
"author": "student-yqqtag",
|
||||
"task_instance_url": "https://0.0.0.0:8000/dashboard/task-instances/6694926301528064/",
|
||||
"task_definition_url": "https://0.0.0.0:8000/dashboard/tasks/6694926301528064/"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"author_is_student": false,
|
||||
"task_definition_name": "Sails unspread it stopped at kearney",
|
||||
"type": "approve",
|
||||
"event_type": "approve",
|
||||
"task_instance": 6296903092273152,
|
||||
"task_claimed_by": "student-yqqtag",
|
||||
"time": 1506475323.256627,
|
||||
"uuid": "1f4bab4d1820400f9b50ed8bf2bb03b3",
|
||||
"id": "1f4bab4d1820400f9b50ed8bf2bb03b3",
|
||||
"author": "eeshangarg",
|
||||
"task_instance_url": "https://0.0.0.0:8000/dashboard/task-instances/6694926301528064/",
|
||||
"task_definition_url": "https://0.0.0.0:8000/dashboard/tasks/6694926301528064/"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"author_is_student": true,
|
||||
"task_definition_name": "Sails unspread it stopped at kearney",
|
||||
"type": "claim",
|
||||
"event_type": "claim",
|
||||
"task_instance": 6296903092273152,
|
||||
"task_claimed_by": "student-yqqtag",
|
||||
"time": 1506475323.256627,
|
||||
"uuid": "1f4bab4d1820400f9b50ed8bf2bb03b3",
|
||||
"id": "1f4bab4d1820400f9b50ed8bf2bb03b3",
|
||||
"author": "student-yqqtag",
|
||||
"task_instance_url": "https://0.0.0.0:8000/dashboard/task-instances/6694926301528064/",
|
||||
"task_definition_url": "https://0.0.0.0:8000/dashboard/tasks/6694926301528064/"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"author_is_student": true,
|
||||
"task_definition_name": "Sails unspread it stopped at kearney",
|
||||
"type": "submit",
|
||||
"event_type": "submit",
|
||||
"task_instance": 6296903092273152,
|
||||
"task_claimed_by": "student-yqqtag",
|
||||
"time": 1506475323.256627,
|
||||
"uuid": "1f4bab4d1820400f9b50ed8bf2bb03b3",
|
||||
"id": "1f4bab4d1820400f9b50ed8bf2bb03b3",
|
||||
"author": "student-yqqtag",
|
||||
"task_instance_url": "https://0.0.0.0:8000/dashboard/task-instances/6694926301528064/",
|
||||
"task_definition_url": "https://0.0.0.0:8000/dashboard/tasks/6694926301528064/"
|
||||
|
|
|
@ -18,7 +18,7 @@ def get_abandon_event_body(payload):
|
|||
# type: (Dict[Text, Any]) -> Text
|
||||
return GCI_MESSAGE_TEMPLATE.format(
|
||||
actor=payload['task_claimed_by'],
|
||||
action='{}ed'.format(payload['type']),
|
||||
action='{}ed'.format(payload['event_type']),
|
||||
task_name=payload['task_definition_name'],
|
||||
task_url=payload['task_definition_url'],
|
||||
)
|
||||
|
@ -27,7 +27,7 @@ def get_submit_event_body(payload):
|
|||
# type: (Dict[Text, Any]) -> Text
|
||||
return GCI_MESSAGE_TEMPLATE.format(
|
||||
actor=payload['task_claimed_by'],
|
||||
action='{}ted'.format(payload['type']),
|
||||
action='{}ted'.format(payload['event_type']),
|
||||
task_name=payload['task_definition_name'],
|
||||
task_url=payload['task_definition_url'],
|
||||
)
|
||||
|
@ -36,7 +36,7 @@ def get_comment_event_body(payload):
|
|||
# type: (Dict[Text, Any]) -> Text
|
||||
return GCI_MESSAGE_TEMPLATE.format(
|
||||
actor=payload['author'],
|
||||
action='{}ed on'.format(payload['type']),
|
||||
action='{}ed on'.format(payload['event_type']),
|
||||
task_name=payload['task_definition_name'],
|
||||
task_url=payload['task_definition_url'],
|
||||
)
|
||||
|
@ -45,7 +45,7 @@ def get_claim_event_body(payload):
|
|||
# type: (Dict[Text, Any]) -> Text
|
||||
return GCI_MESSAGE_TEMPLATE.format(
|
||||
actor=payload['task_claimed_by'],
|
||||
action='{}ed'.format(payload['type']),
|
||||
action='{}ed'.format(payload['event_type']),
|
||||
task_name=payload['task_definition_name'],
|
||||
task_url=payload['task_definition_url'],
|
||||
)
|
||||
|
@ -54,7 +54,7 @@ def get_approve_event_body(payload):
|
|||
# type: (Dict[Text, Any]) -> Text
|
||||
return GCI_MESSAGE_TEMPLATE.format(
|
||||
actor=payload['author'],
|
||||
action='{}d'.format(payload['type']),
|
||||
action='{}d'.format(payload['event_type']),
|
||||
task_name=payload['task_definition_name'],
|
||||
task_url=payload['task_definition_url'],
|
||||
)
|
||||
|
@ -86,7 +86,7 @@ EVENTS_FUNCTION_MAPPER = {
|
|||
|
||||
def get_event(payload):
|
||||
# type: (Dict[Text, Any]) -> Optional[Text]
|
||||
event = payload['type']
|
||||
event = payload['event_type']
|
||||
if event in EVENTS_FUNCTION_MAPPER:
|
||||
return event
|
||||
|
||||
|
|
Loading…
Reference in New Issue