Restore and lock in shop app, admin sidebar, media routing, and Stripe

This commit is contained in:
Zach committed 2026-11-24 18:31:31 +00:00
1 parent 93d83a0d63
commit 3cfea85499
15 files changed
+486 -73

No files matched your search

@@ -0,0 +1,57 @@
# Generated by Django 5.2.19 on 2026-11-23 22:47
import catalog.models
import django.core.validators
import uuid
from decimal import Decimal
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0024_page_share_previews'),
]
operations = [
migrations.CreateModel(
name='ShopOrder',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('reference', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
('item', models.CharField(max_length=320)),
('amount_cents', models.PositiveIntegerField()),
('livemode', models.BooleanField()),
('status', models.CharField(choices=[('open', 'Awaiting payment'), ('paid', 'Paid'), ('expired', 'Expired'), ('failed', 'Checkout unavailable')], db_index=True, default='open', max_length=10)),
('stripe_session', models.CharField(blank=True, max_length=255, null=True, unique=True)),
('payment_intent', models.CharField(blank=True, max_length=255)),
('email', models.EmailField(blank=True, max_length=254)),
('created_at', models.DateTimeField(auto_now_add=True)),
('paid_at', models.DateTimeField(blank=True, null=True)),
('fulfilled', models.BooleanField(default=False)),
],
options={
'ordering': ['-created_at'],
},
),
migrations.AddField(
model_name='booklisting',
name='price_usd',
field=models.DecimalField(blank=True, decimal_places=2, help_text='Charged by Stripe when this product has no variants.', max_digits=8, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.50'))], verbose_name='Stripe price (USD)'),
),
migrations.AddField(
model_name='booklisting',
name='ships',
field=models.BooleanField(default=True, help_text='Collect a shipping address at Stripe Checkout.', verbose_name='Ship this product'),
),
migrations.AlterField(
model_name='productvariant',
name='paypal_url',
field=models.URLField(blank=True, validators=[catalog.models.validate_book_checkout], verbose_name='PayPal Payment Link'),
),
migrations.AlterField(
model_name='productvariant',
name='price_usd',
field=models.DecimalField(blank=True, decimal_places=2, help_text='Charged by Stripe. If using a PayPal link, set the PayPal price separately.', max_digits=8, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='Price (USD)'),
),
]