Skip to content

Commit

Permalink
Merge pull request #295 from felixxm/issue-294
Browse files Browse the repository at this point in the history
Fixed #294 -- Using user.is_authenticated() as a method is deprecated in Django >= 1.10.
  • Loading branch information
paltman authored Dec 21, 2016
2 parents 6615388 + c8317b9 commit c27e1e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pinax/stripe/middleware.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import django
from django.core.urlresolvers import resolve
from django.shortcuts import redirect

Expand All @@ -8,7 +9,11 @@
class ActiveSubscriptionMiddleware(object):

def process_request(self, request):
if request.user.is_authenticated() and not request.user.is_staff:
is_authenticated = request.user.is_authenticated
if django.VERSION < (1, 10):
is_authenticated = is_authenticated()

if is_authenticated and not request.user.is_staff:
url_name = resolve(request.path).url_name
if url_name not in settings.PINAX_STRIPE_SUBSCRIPTION_REQUIRED_EXCEPTION_URLS:
customer = customers.get_customer_for_user(request.user)
Expand Down

0 comments on commit c27e1e4

Please sign in to comment.