method fix for custom authentication

This commit is contained in:
Ryan Detzel 2013-02-23 23:32:47 +01:00
parent 4599cd97cb
commit cd9a192027

View File

@ -202,7 +202,7 @@ If the `.authenticate_header()` method is not overridden, the authentication sch
The following example will authenticate any incoming request as the user given by the username in a custom request header named 'X_USERNAME'.
class ExampleAuthentication(authentication.BaseAuthentication):
def has_permission(self, request, view, obj=None):
def authenticate(self, request):
username = request.META.get('X_USERNAME')
if not username:
return None