Skip to content

Instantly share code, notes, and snippets.

@pydanny
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pydanny/6345bb10e76a039e7172 to your computer and use it in GitHub Desktop.
Save pydanny/6345bb10e76a039e7172 to your computer and use it in GitHub Desktop.
from djwebhooks.decorators import hook
# This assumes the project update was committed by user 'audreyr'
@hook(event="project.update")
def send_project_update(project, owner, identifier):
""" The following help in identifying the webhook
:event: i.e. GitHub commit.push. Not unique!
:owner: Who created a webhook. I.E. pydanny
:identifier: A owner or system defined key. Unique amongst pydanny's webhooks'
"""
# Add MOAR logic here as needed
return {
'title': project.title,
'description': project.description,
'owner': owner.username,
'created': project.created,
'modified': project.modified,
'action': "project.update"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment