You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
757 B
Python
34 lines
757 B
Python
2 years ago
|
from django.contrib import admin
|
||
|
from django.contrib.auth.admin import UserAdmin
|
||
|
|
||
|
from .forms import CustomUserCreationForm
|
||
|
from .models import Plan, Session, User
|
||
|
|
||
|
|
||
|
# Register your models here.
|
||
|
class CustomUserAdmin(UserAdmin):
|
||
|
list_filter = ["plans"]
|
||
|
model = User
|
||
|
add_form = CustomUserCreationForm
|
||
|
fieldsets = (
|
||
|
*UserAdmin.fieldsets,
|
||
|
(
|
||
|
"Stripe information",
|
||
|
{"fields": ("stripe_id",)},
|
||
|
),
|
||
|
(
|
||
|
"Payment information",
|
||
|
{
|
||
|
"fields": (
|
||
|
"plans",
|
||
|
"last_payment",
|
||
|
)
|
||
|
},
|
||
|
),
|
||
|
)
|
||
|
|
||
|
|
||
|
admin.site.register(User, CustomUserAdmin)
|
||
|
admin.site.register(Plan)
|
||
|
admin.site.register(Session)
|