Permalink
Browse files

Removed DEBUG logging on media requests

  • Loading branch information...
1 parent 7866536 commit 8bf9e7791423422124f9ccb999031365cdfdba96 @statico statico committed Jan 19, 2010
Showing with 10 additions and 9 deletions.
  1. +10 −9 facebookconnect/middleware.py
@@ -41,18 +41,19 @@ class FacebookConnectMiddleware(object):
"""Middlware to provide a working facebook object"""
def process_request(self,request):
"""process incoming request"""
-
+
# clear out the storage of fb ids in the local thread
if hasattr(_thread_locals,'fbids'):
del _thread_locals.fbids
-
+
try:
# This is true if anyone has ever used the browser to log in to
# facebook with an acount that has accepted this application.
bona_fide = request.facebook.check_session(request)
uid = request.facebook.uid
- log.debug("Bona Fide: %s, Logged in: %s" % (bona_fide, uid))
-
+ if not request.path.startswith(settings.MEDIA_URL):
+ log.debug("Bona Fide: %s, Logged in: %s" % (bona_fide, uid))
+
if bona_fide and uid:
user = request.user
if user.is_anonymous():
@@ -68,7 +69,7 @@ def process_request(self,request):
if user.is_authenticated() and bona_fide:
try:
fbp = FacebookProfile.objects.get(user=user)
-
+
if fbp.facebook_only():
cur_user = request.facebook.users.getLoggedInUser()
if int(cur_user) != int(request.facebook.uid):
@@ -78,17 +79,17 @@ def process_request(self,request):
except FacebookProfile.DoesNotExsist, ex:
# user doesnt have facebook :(
pass
-
+
except Exception, ex:
- # Because this is a middleware, we can't assume the errors will
+ # Because this is a middleware, we can't assume the errors will
# be caught anywhere useful.
logout(request)
request.facebook.session_key = None
request.facebook.uid = None
log.exception(ex)
-
+
return None
-
+
def process_exception(self,request,exception):
my_ex = exception
if type(exception) == TemplateSyntaxError:

0 comments on commit 8bf9e77

Please sign in to comment.