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

Commit

Permalink
[bug 965828] Tastypie upgrade.
Browse files Browse the repository at this point in the history
- Upgrade tastypie to 0.9.16
- Remove Country and City resources.
  • Loading branch information
glogiotatidis committed Apr 18, 2014
1 parent 1584f56 commit a00ea48
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 792 deletions.
110 changes: 0 additions & 110 deletions docs/api/api-cities.rst

This file was deleted.

96 changes: 0 additions & 96 deletions docs/api/api-countries.rst

This file was deleted.

106 changes: 0 additions & 106 deletions docs/api/api-languages.rst

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/api.rst
Expand Up @@ -43,6 +43,3 @@ API Methods
api-users
api-groups
api-skills
api-languages
api-cities
api-countries
22 changes: 15 additions & 7 deletions mozillians/api/authenticators.py
Expand Up @@ -9,15 +9,23 @@ class AppAuthentication(Authentication):
"""App Authentication."""

def is_authenticated(self, request, **kwargs):
"""Authenticate App."""
"""Authenticate and authorize App."""
app_key = request.GET.get('app_key', '')
app_name = request.GET.get('app_name', '')

result = (APIApp.objects.filter(name__iexact=app_name, key=app_key,
is_active=True).exists())
if result:
statsd.incr('api.auth.success')
else:
try:
app = APIApp.objects.get(name__iexact=app_name, key=app_key, is_active=True)
except APIApp.DoesNotExist:
statsd.incr('api.auth.failed')
return False

statsd.incr('api.auth.success')
if not app.is_mozilla_app:
statsd.incr('api.requests.total_community')
data = request.GET.copy()
data['restricted'] = True
request.GET = data
else:
statsd.incr('api.requests.total_mozilla')
return True

return result
32 changes: 0 additions & 32 deletions mozillians/api/authorisers.py

This file was deleted.

0 comments on commit a00ea48

Please sign in to comment.