fixed CustomUser

This commit is contained in:
Tomislav R 2016-03-07 18:39:24 +01:00
parent e7f11e9556
commit 5c6e0cf7c6
2 changed files with 29 additions and 24 deletions

View file

@ -48,6 +48,9 @@ SECRET_KEY = env('DJANGO_SECRET_KEY')
INSTALLED_APPS = ( INSTALLED_APPS = (
'membership', 'membership',
'filer', 'filer',
'cms', # django CMS itself
'cmsplugin_filer_image',
'djangocms_blog',
'djangocms_admin_style', 'djangocms_admin_style',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
@ -56,7 +59,6 @@ INSTALLED_APPS = (
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django.contrib.sites', 'django.contrib.sites',
'cms', # django CMS itself
'treebeard', # utilities for implementing a tree 'treebeard', # utilities for implementing a tree
'menus', # helper for model independent hierarchical website navigation 'menus', # helper for model independent hierarchical website navigation
'sekizai', # for javascript and css management 'sekizai', # for javascript and css management
@ -70,7 +72,6 @@ INSTALLED_APPS = (
'djangocms_page_meta', 'djangocms_page_meta',
# django-filer # django-filer
'cmsplugin_filer_file', 'cmsplugin_filer_file',
'cmsplugin_filer_image',
'cmsplugin_filer_folder', 'cmsplugin_filer_folder',
'cmsplugin_filer_link', 'cmsplugin_filer_link',
'cmsplugin_filer_teaser', 'cmsplugin_filer_teaser',
@ -94,7 +95,6 @@ INSTALLED_APPS = (
'ungleich', 'ungleich',
'hosting', 'hosting',
'digitalglarus', 'digitalglarus',
'djangocms_blog',
) )
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
@ -268,28 +268,28 @@ META_SITE_PROTOCOL = 'http'
META_USE_SITES = True META_USE_SITES = True
MIGRATION_MODULES = { MIGRATION_MODULES = {
'cms': 'cms.migrations', # 'cms': 'cms.migrations',
# 'filer': 'filer.migrations_django', # 'filer': 'filer.migrations_django',
'menus': 'menus.migrations_django', # 'menus': 'menus.migrations_django',
'djangocms_flash': 'djangocms_flash.migrations_django', # 'djangocms_flash': 'djangocms_flash.migrations_django',
'djangocms_googlemap': 'djangocms_googlemap.migrations_django', # 'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
'djangocms_inherit': 'djangocms_inherit.migrations_django', # 'djangocms_inherit': 'djangocms_inherit.migrations_django',
'djangocms_link': 'djangocms_link.migrations_django', # 'djangocms_link': 'djangocms_link.migrations_django',
'djangocms_snippet': 'djangocms_snippet.migrations_django', # 'djangocms_snippet': 'djangocms_snippet.migrations_django',
'djangocms_teaser': 'djangocms_teaser.migrations_django', # 'djangocms_teaser': 'djangocms_teaser.migrations_django',
'djangocms_column': 'djangocms_column.migrations_django', # 'djangocms_column': 'djangocms_column.migrations_django',
'djangocms_flash': 'djangocms_flash.migrations_django', # 'djangocms_flash': 'djangocms_flash.migrations_django',
'djangocms_googlemap': 'djangocms_googlemap.migrations_django', # 'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
'djangocms_inherit': 'djangocms_inherit.migrations_django', # 'djangocms_inherit': 'djangocms_inherit.migrations_django',
'djangocms_style': 'djangocms_style.migrations_django', # 'djangocms_style': 'djangocms_style.migrations_django',
# 'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django', # 'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django', # 'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django',
'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django', # 'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django',
'cmsplugin_filer_link': 'cmsplugin_filer_link.migrations_django', # 'cmsplugin_filer_link': 'cmsplugin_filer_link.migrations_django',
'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django', # 'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django',
'cmsplugin_filer_utils': 'cmsplugin_filer_utils.migrations_django', # 'cmsplugin_filer_utils': 'cmsplugin_filer_utils.migrations_django',
'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django', # 'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django',
'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations', # 'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations',
} }
STATICFILES_FINDERS = ( STATICFILES_FINDERS = (
@ -407,4 +407,4 @@ META_INCLUDE_KEYWORDS = ["ungleich", "hosting", "switzerland",
META_USE_SITES = True META_USE_SITES = True
PARLER_LANGUAGES = {1: ({'code': 'en-us'}, {'code': 'de'},)} PARLER_LANGUAGES = {1: ({'code': 'en-us'}, {'code': 'de'},)}
# AUTH_USER_MODEL = 'membership.CustomUser' AUTH_USER_MODEL = 'membership.CustomUser'

View file

@ -51,6 +51,7 @@ class CustomUser(AbstractBaseUser):
objects = MyUserManager() objects = MyUserManager()
USERNAME_FIELD = "email" USERNAME_FIELD = "email"
REQUIRED_FIELDS = ['name','password']
@classmethod @classmethod
def register(cls, name, password, email): def register(cls, name, password, email):
@ -74,6 +75,10 @@ class CustomUser(AbstractBaseUser):
user.validated = 1 user.validated = 1
return True return True
return False return False
def is_superuser(self):
return True
def is_admin(self):
return True
def get_full_name(self): def get_full_name(self):
# The user is identified by their email address # The user is identified by their email address