mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 19:06:09 +00:00
django: Use request.user.is_authenticated consistently.
In Django 2.0, request.user.is_authenticated stops supporting `.is_authenticated()` and becomes just a property. In 1.11, it's a CallableProperty (i.e. can be used either way), and we already use it as a property in several other places, so we should just switch to using it consistently now to get it off of our Django 2.x migration checklist.
This commit is contained in:
@@ -311,6 +311,6 @@ def plans_view(request: HttpRequest) -> HttpResponse:
|
||||
realm_plan_type = realm.plan_type
|
||||
if realm.plan_type == Realm.SELF_HOSTED and settings.PRODUCTION:
|
||||
return HttpResponseRedirect('https://zulipchat.com/plans')
|
||||
if not request.user.is_authenticated():
|
||||
if not request.user.is_authenticated:
|
||||
return redirect_to_login(next="plans")
|
||||
return render(request, "zerver/plans.html", context={"realm_plan_type": realm_plan_type})
|
||||
|
||||
Reference in New Issue
Block a user