Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Support Django 1.11 beta #72

Merged
merged 4 commits into from Mar 19, 2017
Merged

Conversation

giginet
Copy link
Contributor

@giginet giginet commented Mar 17, 2017

closes #70 closes #71

@coveralls
Copy link

coveralls commented Mar 17, 2017

Coverage Status

Coverage remained the same at 96.791% when pulling f1fff24 on giginet:support-django111 into bef196d on lambdalisue:master.

@coveralls
Copy link

coveralls commented Mar 17, 2017

Coverage Status

Coverage remained the same at 96.791% when pulling 6ca3372 on giginet:support-django111 into bef196d on lambdalisue:master.

@coveralls
Copy link

coveralls commented Mar 17, 2017

Coverage Status

Coverage remained the same at 96.791% when pulling ec63d17 on giginet:support-django111 into bef196d on lambdalisue:master.

@coveralls
Copy link

coveralls commented Mar 17, 2017

Coverage Status

Coverage increased (+0.006%) to 96.797% when pulling 5949739 on giginet:support-django111 into bef196d on lambdalisue:master.

@giginet
Copy link
Contributor Author

giginet commented Mar 17, 2017

@lambdalisue Please Review 🙏

@@ -26,6 +26,19 @@ def isiterable(x):
except ImportError:
from django.utils.importlib import import_module

if django.VERSION >= (1, 11):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is_authenticated and is_anonymous has become attributes from Django 1.10 (internally, it is a property which returns a callable boolean for backward compatibility ref)

So the line should be the following even if the method style is supported in Django 1.10

if django.VERSION >= (1, 10):

https://docs.djangoproject.com/en/1.10/ref/contrib/auth/#django.contrib.auth.models.User.is_authenticated

@@ -26,6 +26,19 @@ def isiterable(x):
except ImportError:
from django.utils.importlib import import_module

if django.VERSION >= (1, 11):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unusual condition should be in a IF block. I meant the code should be

if django.VERSION < (1, 10):
    # For backward compatibility
    ...
else:
    # This is a default way
    ...

@@ -26,6 +26,19 @@ def isiterable(x):
except ImportError:
from django.utils.importlib import import_module

if django.VERSION >= (1, 11):
def is_authenticated(u):
return u.is_authenticated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use user or user_obj instead of u.

@coveralls
Copy link

coveralls commented Mar 19, 2017

Coverage Status

Coverage increased (+0.006%) to 96.797% when pulling c1454e9 on giginet:support-django111 into bef196d on lambdalisue:master.

@giginet giginet merged commit 70d9cbd into jazzband:master Mar 19, 2017
@giginet giginet deleted the support-django111 branch March 19, 2017 09:22
@lambdalisue
Copy link
Contributor

Thanks 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants