mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-07-30 23:38:02 -04:00
- Implemented PDF generation for collections, allowing users to create printable itineraries. - Added support for Noto fonts to ensure proper rendering of text and emojis in PDFs. - Enhanced admin interfaces for achievements and adventures, improving usability and data management. - Introduced new fields and methods in models and serializers to support geolocation features and improve data handling. - Updated migrations to transition from latitude/longitude fields to a unified PointField for geographic data. - Added tests to validate PDF generation functionality and ensure reliability.
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
from django.conf import settings
|
|
from django.contrib import admin
|
|
|
|
from .models import Subscription
|
|
|
|
|
|
if settings.CLOUD_MODE:
|
|
@admin.register(Subscription)
|
|
class SubscriptionAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"user",
|
|
"status",
|
|
"trial_ends_at",
|
|
"current_period_ends_at",
|
|
"cancel_at_period_end",
|
|
"created_at",
|
|
)
|
|
search_fields = ("user__username", "stripe_customer_id", "stripe_subscription_id")
|
|
list_filter = ("status", "cancel_at_period_end")
|
|
autocomplete_fields = ("user",)
|
|
readonly_fields = ("created_at", "updated_at")
|
|
date_hierarchy = "trial_ends_at"
|
|
|
|
fieldsets = (
|
|
(None, {"fields": ("user", "status", "cancel_at_period_end")}),
|
|
(
|
|
"Stripe",
|
|
{
|
|
"fields": ("stripe_customer_id", "stripe_subscription_id"),
|
|
},
|
|
),
|
|
(
|
|
"Billing periods",
|
|
{
|
|
"fields": ("trial_ends_at", "current_period_ends_at"),
|
|
},
|
|
),
|
|
(
|
|
"Metadata",
|
|
{"classes": ("collapse",), "fields": ("created_at", "updated_at")},
|
|
),
|
|
)
|