Revision 9a06d96f snf-astakos-app/astakos/im/management/commands/_common.py

b/snf-astakos-app/astakos/im/management/commands/_common.py
39 39

  
40 40
from astakos.im.models import AstakosUser
41 41

  
42
content_type = None
42
DEFAULT_CONTENT_TYPE = None
43 43

  
44 44

  
45 45
def get_user(email_or_id, **kwargs):
......
67 67

  
68 68

  
69 69
def get_astakosuser_content_type():
70
    if content_type:
71
        return content_type
72

  
73 70
    try:
74 71
        return ContentType.objects.get(app_label='im',
75 72
                                       model='astakosuser')
76 73
    except:
77
        return content_type
74
        return DEFAULT_CONTENT_TYPE
78 75

  
79 76

  
80 77
def add_user_permission(user, pname):

Also available in: Unified diff