Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1143 from johngian/pr-1141
Browse files Browse the repository at this point in the history
[Fix bug 1102290] Publish /contribute.json file
  • Loading branch information
johngian committed Jan 7, 2015
2 parents 2e91716 + 9ffdae3 commit 91ed5e3
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
36 changes: 36 additions & 0 deletions mozillians/humans/templates/humans/contribute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "Mozillians.org",
"description": "Mozillians is the community directory for core Mozilla volunteers and staff. It's a tool used by everyone involved with Mozilla, and it's the primary way that Mozillians can find each other.",
"repository": {
"url": "https://github.com/mozilla/mozillians/",
"license": "BSD"
},
"participate": {
"home": "https://wiki.mozilla.org/Mozillians",
"docs": "http://mozillians.readthedocs.org",
"mailing-list": "https://lists.mozilla.org/listinfo/dev-community-tools",
"irc": "irc://irc.mozilla.org/#commtools",
"irc-contacts": [
"giorgos",
"nemo-yiannis",
"tasos",
"williamr"
]
},
"bugs": {
"list": "https://bugzilla.mozilla.org/buglist.cgi?quicksearch=OPEN%20product%3A%22Community%20Tools%22%20component%3APhonebook",
"report": "https://bugzilla.mozilla.org/enter_bug.cgi?product=Community%20Tools&component=Phonebook"
},
"urls": {
"prod": "https://mozillians.org",
"stage": "https://mozillians.allizom.org",
"dev": "https://mozillians-dev.allizom.org"
},
"keywords": [
"python",
"django",
"html",
"javascript"
]
}

3 changes: 2 additions & 1 deletion mozillians/humans/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

urlpatterns = patterns(
'mozillians.humans',
url(r'^humans.txt$', 'views.humans', name='humans')
url(r'^humans.txt$', 'views.humans', name='humans'),
url(r'^contribute.json/$', 'views.contribute_view', name='contribute-view')
)
10 changes: 9 additions & 1 deletion mozillians/humans/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.conf import settings
from django.shortcuts import redirect
from django.http import HttpResponse
from django.shortcuts import redirect, render

from mozillians.common.decorators import allow_public
from mozillians.common.helpers import absolutify
Expand All @@ -8,3 +9,10 @@
@allow_public
def humans(request):
return redirect(absolutify(settings.HUMANSTXT_URL))


@allow_public
def contribute_view(request):
"""Generate a contribute.json"""
template = render(request, 'humans/contribute.json')
return HttpResponse(template, mimetype='application/json')
1 change: 1 addition & 0 deletions mozillians/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def JINJA_CONFIG():
'csp',
'api',
'browserid',
'contribute.json',
'admin',
'autocomplete',
'humans.txt'
Expand Down

0 comments on commit 91ed5e3

Please sign in to comment.