Projet

Général

Profil

0001-profile-give-is_authenticated-is_anonymous-methods-t.patch

Frédéric Péters, 29 mars 2019 17:14

Télécharger (1,17 ko)

Voir les différences:

Subject: [PATCH] profile: give is_authenticated/is_anonymous methods to
 proxied user (#31858)

 combo/profile/utils.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
combo/profile/utils.py
17 17
from django.conf import settings
18 18
from django.contrib.auth.models import User
19 19

  
20
if django.VERSION < (1, 11, 0):
21
    CallableFalse, CallableTrue = False, True
22
else:
23
    from django.utils.deprecation import CallableFalse, CallableTrue
20 24

  
21 25
if 'mellon' in settings.INSTALLED_APPS:
22 26
    from mellon.models import UserSAMLIdentifier
......
32 36
    def get_name_id(self):
33 37
        return self.name_id
34 38

  
39
    def is_authenticated(self):
40
        return CallableTrue
41

  
42
    def is_anonymous(self):
43
        return CallableFalse
44

  
35 45

  
36 46
def get_user_from_name_id(name_id, raise_on_missing=False):
37 47
    if not UserSAMLIdentifier:
38
-