Skip to content

Commit

Permalink
Use user.is_authenticated as an attribute rockstor#2664
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
FroggyFlox committed Aug 21, 2023
1 parent 3f87942 commit f84771e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/rockstor/storageadmin/views/home.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
Copyright (c) 2012-2023 RockStor, Inc. <https://rockstor.com>
This file is part of RockStor.
RockStor is free software; you can redistribute it and/or modify
Expand All @@ -13,7 +13,7 @@
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

from django.shortcuts import render
Expand All @@ -28,6 +28,7 @@

logger = logging.getLogger(__name__)


def login_page(request):
return render(request, "login.html")

Expand Down Expand Up @@ -65,7 +66,7 @@ def home(request):
"update_channel": update_channel,
}
logger.debug("context={}".format(context))
if request.user.is_authenticated():
if request.user.is_authenticated:
logger.debug("ABOUT TO RENDER INDEX")
return render(request, "index.html", context)
else:
Expand Down

0 comments on commit f84771e

Please sign in to comment.