Skip to content

Commit 6cfc1f5

Browse files
committed
increase min and simplify
1 parent 325a3a5 commit 6cfc1f5

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

posthog/exception_integrations/django.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class DjangoIntegration:
3232
identifier = "django"
3333

3434
def __init__(self, capture_exception_fn=None):
35-
if DJANGO_VERSION < (1, 8):
36-
raise IntegrationEnablingError("Django 1.8 or newer is required.")
35+
if DJANGO_VERSION < (1, 10):
36+
raise IntegrationEnablingError("Django 1.10 or newer is required.")
3737

3838
# TODO: Right now this seems too complicated / overkill for us, but seems like we can automatically plug in middlewares
3939
# which is great for users (they don't need to do this) and everything should just work.
@@ -58,17 +58,6 @@ def uninstall(self):
5858
pass
5959

6060

61-
if DJANGO_VERSION < (1, 10):
62-
63-
def is_authenticated(request_user):
64-
return request_user.is_authenticated()
65-
66-
else:
67-
68-
def is_authenticated(request_user):
69-
return request_user.is_authenticated
70-
71-
7261
class DjangoRequestExtractor:
7362
def __init__(self, request):
7463
# type: (Any) -> None
@@ -104,7 +93,7 @@ def user(self):
10493

10594
user = getattr(self.request, "user", None)
10695

107-
if user is None or not is_authenticated(user):
96+
if user is None or not user.is_authenticated:
10897
return user_data
10998

11099
try:

0 commit comments

Comments
 (0)