From fb3627eaf8399a56584f8e5151ea82315524d883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 1 Apr 2020 19:50:06 +0200 Subject: [PATCH] misc: remove usage of CallableTrue (#41239) --- hobo/rest_authentication.py | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/hobo/rest_authentication.py b/hobo/rest_authentication.py index e6c9e03..c481fb6 100644 --- a/hobo/rest_authentication.py +++ b/hobo/rest_authentication.py @@ -8,10 +8,6 @@ from django.contrib.auth import get_user_model from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.db.models.fields import FieldDoesNotExist -try: - from django.utils.deprecation import CallableTrue -except ImportError: - CallableTrue = True from django.utils.module_loading import import_string try: @@ -22,14 +18,8 @@ except ImportError: class AnonymousAuthenticServiceUser(AnonymousUser): '''This virtual user hold permissions for other publik services''' - - @property - def is_anonymous(self): - return CallableTrue - - @property - def is_authenticated(self): - return CallableTrue + is_anonymous = True + is_authenticated = True def has_perm(self, *args, **kwargs): return True @@ -51,14 +41,8 @@ class AnonymousAuthenticServiceUser(AnonymousUser): class AnonymousAdminServiceUser(AnonymousUser): '''This virtual user hold permissions for other publik services''' is_staff = True - - @property - def is_anonymous(self): - return CallableTrue - - @property - def is_authenticated(self): - return CallableTrue + is_anonymous = True + is_authenticated = True def __unicode__(self): return 'Publik Service Admin'