# Path: authemail/admin.py
# class EmailUserAdmin(UserAdmin):
#     fieldsets = (
#         (None, {'fields': ('email', 'password')}),
#         (_('Personal Info'), {'fields': ('first_name', 'last_name')}),
#         (_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',
#                                        'groups', 'user_permissions')}),
#         (_('Important dates'), {'fields': ('last_login', 'date_joined')}),
#     )
#     add_fieldsets = (
#         (None, {
#             'classes': ('wide',),
#             'fields': ('email', 'password1', 'password2'),
#         }),
#     )
#     form = EmailUserChangeForm
#     add_form = EmailUserCreationForm
#     inlines = [SignupCodeInline, EmailChangeCodeInline, PasswordResetCodeInline]
#     list_display = ('email', 'is_verified', 'first_name', 'last_name',
#                     'is_staff')
#     search_fields = ('first_name', 'last_name', 'email')
#     ordering = ('email',)


from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from authemail.admin import EmailUserAdmin
from accounts.models import VerifiedUser




class MyUserAdmin(EmailUserAdmin):
    fieldsets = (
        (None, {'fields': ('email', 'password')}),
        (_('Personal Info'), {'fields': ('first_name', 'last_name')}),
        (_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',
                                       'is_verified', 'groups',
                                       'user_permissions')}),
        (_('Important dates'), {'fields': ('last_login', 'date_joined')}),
        (_('Custom info'), {'fields': ('date_of_birth',)}),
    )


class VerifiedUserAdmin(MyUserAdmin):
    def has_add_permission(self, request):
        return False



# Path: authemail/admin.py
# class EmailUserAdmin(UserAdmin):
#     fieldsets = (
#         (None, {'fields': ('email', 'password')}),
#         (_('Personal Info'), {'fields': ('first_name', 'last_name')}),
#         (_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',
#                                        'groups', 'user_permissions')}),
#         (_('Important dates'), {'fields': ('last_login', 'date_joined')}),
#     )
#     add_fieldsets = (
#         (None, {
#             'classes': ('wide',),
#             'fields': ('email', 'password1', 'password2'),
#         }),
#     )
#     form = EmailUserChangeForm
#     add_form = EmailUserCreationForm
#     inlines = [SignupCodeInline, EmailChangeCodeInline, PasswordResetCodeInline]
#     list_display = ('email', 'is_verified', 'first_name', 'last_name',
#                     'is_staff')
#     search_fields = ('first_name', 'last_name', 'email')
#     ordering = ('email',)


# Path: example_project/accounts/admin.py
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from authemail.admin import EmailUserAdmin
from accounts.models import VerifiedUser





class MyUserAdmin(EmailUserAdmin):
    fieldsets = (
        (None, {'fields': ('email', 'password')}),
        (_('Personal Info'), {'fields': ('first_name', 'last_name')}),
        (_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',
                                       'is_verified', 'groups',
                                       'user_permissions')}),
        (_('Important dates'), {'fields': ('last_login', 'date_joined')}),
        (_('Custom info'), {'fields': ('date_of_birth',)}),
    )


class VerifiedUserAdmin(MyUserAdmin):
    def has_add_permission(self, request):
        return False



admin.site.unregister(get_user_model())