fixed CustomUser
This commit is contained in:
parent
3157db235a
commit
b8824b3f46
2 changed files with 29 additions and 24 deletions
|
@ -48,6 +48,9 @@ SECRET_KEY = env('DJANGO_SECRET_KEY')
|
|||
INSTALLED_APPS = (
|
||||
'membership',
|
||||
'filer',
|
||||
'cms', # django CMS itself
|
||||
'cmsplugin_filer_image',
|
||||
'djangocms_blog',
|
||||
'djangocms_admin_style',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
|
@ -56,7 +59,6 @@ INSTALLED_APPS = (
|
|||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django.contrib.sites',
|
||||
'cms', # django CMS itself
|
||||
'treebeard', # utilities for implementing a tree
|
||||
'menus', # helper for model independent hierarchical website navigation
|
||||
'sekizai', # for javascript and css management
|
||||
|
@ -70,7 +72,6 @@ INSTALLED_APPS = (
|
|||
'djangocms_page_meta',
|
||||
# django-filer
|
||||
'cmsplugin_filer_file',
|
||||
'cmsplugin_filer_image',
|
||||
'cmsplugin_filer_folder',
|
||||
'cmsplugin_filer_link',
|
||||
'cmsplugin_filer_teaser',
|
||||
|
@ -94,7 +95,6 @@ INSTALLED_APPS = (
|
|||
'ungleich',
|
||||
'hosting',
|
||||
'digitalglarus',
|
||||
'djangocms_blog',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
|
@ -268,28 +268,28 @@ META_SITE_PROTOCOL = 'http'
|
|||
META_USE_SITES = True
|
||||
|
||||
MIGRATION_MODULES = {
|
||||
'cms': 'cms.migrations',
|
||||
# 'cms': 'cms.migrations',
|
||||
# 'filer': 'filer.migrations_django',
|
||||
'menus': 'menus.migrations_django',
|
||||
'djangocms_flash': 'djangocms_flash.migrations_django',
|
||||
'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
|
||||
'djangocms_inherit': 'djangocms_inherit.migrations_django',
|
||||
'djangocms_link': 'djangocms_link.migrations_django',
|
||||
'djangocms_snippet': 'djangocms_snippet.migrations_django',
|
||||
'djangocms_teaser': 'djangocms_teaser.migrations_django',
|
||||
'djangocms_column': 'djangocms_column.migrations_django',
|
||||
'djangocms_flash': 'djangocms_flash.migrations_django',
|
||||
'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
|
||||
'djangocms_inherit': 'djangocms_inherit.migrations_django',
|
||||
'djangocms_style': 'djangocms_style.migrations_django',
|
||||
# 'menus': 'menus.migrations_django',
|
||||
# 'djangocms_flash': 'djangocms_flash.migrations_django',
|
||||
# 'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
|
||||
# 'djangocms_inherit': 'djangocms_inherit.migrations_django',
|
||||
# 'djangocms_link': 'djangocms_link.migrations_django',
|
||||
# 'djangocms_snippet': 'djangocms_snippet.migrations_django',
|
||||
# 'djangocms_teaser': 'djangocms_teaser.migrations_django',
|
||||
# 'djangocms_column': 'djangocms_column.migrations_django',
|
||||
# 'djangocms_flash': 'djangocms_flash.migrations_django',
|
||||
# 'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
|
||||
# 'djangocms_inherit': 'djangocms_inherit.migrations_django',
|
||||
# 'djangocms_style': 'djangocms_style.migrations_django',
|
||||
# 'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
|
||||
'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django',
|
||||
'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django',
|
||||
'cmsplugin_filer_link': 'cmsplugin_filer_link.migrations_django',
|
||||
'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django',
|
||||
'cmsplugin_filer_utils': 'cmsplugin_filer_utils.migrations_django',
|
||||
'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django',
|
||||
'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations',
|
||||
# 'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django',
|
||||
# 'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django',
|
||||
# 'cmsplugin_filer_link': 'cmsplugin_filer_link.migrations_django',
|
||||
# 'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django',
|
||||
# 'cmsplugin_filer_utils': 'cmsplugin_filer_utils.migrations_django',
|
||||
# 'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django',
|
||||
# 'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations',
|
||||
}
|
||||
|
||||
STATICFILES_FINDERS = (
|
||||
|
@ -407,4 +407,4 @@ META_INCLUDE_KEYWORDS = ["ungleich", "hosting", "switzerland",
|
|||
META_USE_SITES = True
|
||||
|
||||
PARLER_LANGUAGES = {1: ({'code': 'en-us'}, {'code': 'de'},)}
|
||||
# AUTH_USER_MODEL = 'membership.CustomUser'
|
||||
AUTH_USER_MODEL = 'membership.CustomUser'
|
||||
|
|
|
@ -51,6 +51,7 @@ class CustomUser(AbstractBaseUser):
|
|||
objects = MyUserManager()
|
||||
|
||||
USERNAME_FIELD = "email"
|
||||
REQUIRED_FIELDS = ['name','password']
|
||||
|
||||
@classmethod
|
||||
def register(cls, name, password, email):
|
||||
|
@ -74,6 +75,10 @@ class CustomUser(AbstractBaseUser):
|
|||
user.validated = 1
|
||||
return True
|
||||
return False
|
||||
def is_superuser(self):
|
||||
return True
|
||||
def is_admin(self):
|
||||
return True
|
||||
|
||||
def get_full_name(self):
|
||||
# The user is identified by their email address
|
||||
|
|
Loading…
Reference in a new issue