0001-misc-remove-usage-of-CallableTrue-41239.patch
hobo/rest_authentication.py | ||
---|---|---|
8 | 8 |
from django.conf import settings |
9 | 9 |
from django.contrib.auth.models import AnonymousUser |
10 | 10 |
from django.db.models.fields import FieldDoesNotExist |
11 |
try: |
|
12 |
from django.utils.deprecation import CallableTrue |
|
13 |
except ImportError: |
|
14 |
CallableTrue = True |
|
15 | 11 |
from django.utils.module_loading import import_string |
16 | 12 | |
17 | 13 |
try: |
... | ... | |
22 | 18 | |
23 | 19 |
class AnonymousAuthenticServiceUser(AnonymousUser): |
24 | 20 |
'''This virtual user hold permissions for other publik services''' |
25 | ||
26 |
@property |
|
27 |
def is_anonymous(self): |
|
28 |
return CallableTrue |
|
29 | ||
30 |
@property |
|
31 |
def is_authenticated(self): |
|
32 |
return CallableTrue |
|
21 |
is_anonymous = True |
|
22 |
is_authenticated = True |
|
33 | 23 | |
34 | 24 |
def has_perm(self, *args, **kwargs): |
35 | 25 |
return True |
... | ... | |
51 | 41 |
class AnonymousAdminServiceUser(AnonymousUser): |
52 | 42 |
'''This virtual user hold permissions for other publik services''' |
53 | 43 |
is_staff = True |
54 | ||
55 |
@property |
|
56 |
def is_anonymous(self): |
|
57 |
return CallableTrue |
|
58 | ||
59 |
@property |
|
60 |
def is_authenticated(self): |
|
61 |
return CallableTrue |
|
44 |
is_anonymous = True |
|
45 |
is_authenticated = True |
|
62 | 46 | |
63 | 47 |
def __unicode__(self): |
64 | 48 |
return 'Publik Service Admin' |
65 |
- |