0002-misc-remove-compatibility-values-for-is_anonymous-is.patch
combo/profile/utils.py | ||
---|---|---|
16 | 16 | |
17 | 17 |
from django.conf import settings |
18 | 18 |
from django.contrib.auth.models import User |
19 |
from django.utils.deprecation import CallableFalse, CallableTrue |
|
20 | 19 | |
21 | 20 |
if 'mellon' in settings.INSTALLED_APPS: |
22 | 21 |
from mellon.models import UserSAMLIdentifier |
... | ... | |
25 | 24 | |
26 | 25 | |
27 | 26 |
class ProxiedUser(object): |
27 |
is_authenticated = True |
|
28 |
is_anonymous = False |
|
29 | ||
28 | 30 |
def __init__(self, name_id): |
29 | 31 |
self.name_id = name_id |
30 | 32 |
self.email = '' |
... | ... | |
32 | 34 |
def get_name_id(self): |
33 | 35 |
return self.name_id |
34 | 36 | |
35 |
@property |
|
36 |
def is_authenticated(self): |
|
37 |
return CallableTrue |
|
38 | ||
39 |
@property |
|
40 |
def is_anonymous(self): |
|
41 |
return CallableFalse |
|
42 | ||
43 | 37 | |
44 | 38 |
def get_user_from_name_id(name_id, raise_on_missing=False): |
45 | 39 |
if not UserSAMLIdentifier: |
46 |
- |