Skip to content

Commit

Permalink
Construct a nice url when new repos are added.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Jun 17, 2014
1 parent 5cd6379 commit 8b22a89
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions github2fedmsg/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ def webhook(request):
if event_type == 'ping':
event_type = 'webhook'

# They don't actually tell us which repo is signed up, so, for
# presentation purposes only, we'll rip out the repo name here and
# build a nice human-clickable url.
tokens = payload['hook']['url'].split('/')
owner, repo = tokens[-4], tokens[-3]
payload['compare'] = 'https://github.com/%s/%s' % (owner, repo)

# Turn just 'issues' into 'issue.reopened'
if event_type == 'issues':
event_type = 'issue.' + payload['action']
Expand Down

0 comments on commit 8b22a89

Please sign in to comment.