Allowing oauth users to not bother having a user agent.

This commit is contained in:
Samuel Clay 2014-01-27 13:00:41 -08:00
parent 5b543377a8
commit 4cb75f782d
2 changed files with 3 additions and 3 deletions

View file

@ -183,12 +183,14 @@ BANNED_USER_AGENTS = (
'feed reader-background',
'missing',
)
class UserAgentBanMiddleware:
def process_request(self, request):
user_agent = request.environ.get('HTTP_USER_AGENT', 'missing').lower()
if 'profile' in request.path: return
if 'haproxy' in request.path: return
if 'account' in request.path: return
if getattr(settings, 'TEST_DEBUG'): return
if any(ua in user_agent for ua in BANNED_USER_AGENTS):
@ -200,4 +202,3 @@ class UserAgentBanMiddleware:
return HttpResponse(json.encode(data), status=403, mimetype='text/json')

View file

@ -128,7 +128,6 @@ OAUTH2_PROVIDER = {
'write': 'Create new saved stories, shared stories, and subscriptions.',
'ifttt': 'Pair your NewsBlur account with other IFTTT channels.',
},
'CLIENT_ID_GENERATOR_CLASS': 'oauth2_provider.generators.ClientIdGenerator',
}