Skip to content

Conversation

@FroggyFlox
Copy link
Member

Fix #2664
@phillxnet, @Hooverdan96: ready for review

Prior to Django 1.10, user.is_authenticated() was a method. Since then, compatibility was ensured but this compatibility will be removed in Django 2.0. See #2664 for more details and background.

This Pull Request (PR) simply proposes to move to using the user.is_authenticated attribute instead.

Functional testing

Prior to this PR, fully refreshing a webpage (Ctrl + Shift + R) would show the warning described in #2664.
After this PR, this no longer appears.

Unit testing

All tests still pass:

buildvm155:/opt/rockstor # cd src/rockstor/ && poetry run django-admin test ; cd -
Creating test database for alias 'default'...
Creating test database for alias 'smart_manager'...
System check identified no issues (0 silenced).
......................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 262 tests in 14.807s

OK
Destroying test database for alias 'default'...
Destroying test database for alias 'smart_manager'...

Prior to Django 1.10, user.is_authenticated() was a method.
Since then, compatibility was ensured but this compatibility will be
removed in Django 2.0. This commit thus moves to using the
user.is_authenticated attribute instead.
@FroggyFlox FroggyFlox linked an issue Aug 21, 2023 that may be closed by this pull request
@FroggyFlox FroggyFlox added the needs review Ideally by prior rockstor-core contributor label Aug 21, 2023
@phillxnet
Copy link
Member

@FroggyFlox Merging on the basis of the testing provided. As you say this does look like a simple drop-in replacement.
Thanks again for yet more preparation re the current Django milestone.

@phillxnet phillxnet merged commit b4128ad into rockstor:testing Aug 22, 2023
@FroggyFlox FroggyFlox deleted the 2664-models.User.is_authenticated()-will-be-deprecated-in-Django-2.0 branch October 20, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Ideally by prior rockstor-core contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(t) models.User.is_authenticated() will be deprecated in Django 2.0

2 participants