src/ldt/ldt/management/__init__.py
author ymh <ymh.work@gmail.com>
Thu, 31 Dec 2015 23:38:18 +0100
changeset 1475 e6c7b85a624b
parent 1362 df60d20f965c
permissions -rw-r--r--
upgrade metadataplayer

from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import signals


def post_save_user(instance, raw, created, **kwargs):
    if created:
        try:
            owner = instance
        except ObjectDoesNotExist:
            User = get_user_model()
            owner = User(instance)
            owner.save() 
    
signals.post_save.connect(post_save_user, settings.AUTH_USER_MODEL) 
        
def test_ldt():
    if 'ldt.ldt_utils' in settings.INSTALLED_APPS:
        return True
    else:
        return False

def get_content_type_list() :
    content_type_list = []
    return content_type_list