Skip to content

Commit

Permalink
Docstring on middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
flashingpumpkin committed Jan 20, 2010
1 parent a4bbf10 commit c51e723
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions socialregistration/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

class FacebookMiddleware(object):
def process_request(self, request):
if getattr(request, 'facebook', None):
"""
Enables request.facebook in your views once the user authenticated the
application and connected with facebook. You might want to use this
if you don't feel confortable with the javascript library.
"""
if getattr(request, 'facebook', None) is None:
raise AttributeError(_('Please make sure you have *facebook.djangofb.FacebookMiddleware* installed as a middleware.'))
else:
request.facebook.check_session(request)
request.facebook.check_session(request)
return None

0 comments on commit c51e723

Please sign in to comment.