Archived
Address Reid's PR #25 review comments
🔴 Blocking fixes: - Add reader app migration (apps/reader/migrations/0001_initial.py) - Remove duplicate ReadingSettings from apps.books to resolve model clash with apps.reader.ReadingSettings (keep richer reader version) - Redirect books serializers/views to use reader app's ReadingSettings - Update frontend API endpoints to match main's backend routes: /api/books/ebooks/{id}/toc/ (chapters) /api/books/ebooks/{id}/content/?page=N (chapter content) /api/books/ebooks/{id}/progress/ (GET/PATCH progress) - Add DOMPurify sanitization for dangerouslySetInnerHTML (XSS fix) 🟡 Non-blocking fixes: - Fix CSS typo: landascape -> landscape in reader.css - Add null-safe fallback for book.title in ReadingPage
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# Generated by Django 5.1.7 on 2026-05-29 06:29
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('users', '__first__'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ReadingSettings',
|
||||
fields=[
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='reading_settings', serialize=False, to=settings.AUTH_USER_MODEL)),
|
||||
('font_family', models.CharField(choices=[('sans-serif', 'Sans-serif'), ('serif', 'Serif'), ('monospace', 'Monospace')], default='serif', max_length=32)),
|
||||
('font_size', models.PositiveSmallIntegerField(default=18)),
|
||||
('line_height', models.FloatField(default=1.6)),
|
||||
('margin_width', models.PositiveSmallIntegerField(default=16)),
|
||||
('background_color', models.CharField(default='#f5f0eb', max_length=7)),
|
||||
('text_color', models.CharField(default='#1a1a1a', max_length=7)),
|
||||
('brightness', models.PositiveSmallIntegerField(default=100)),
|
||||
('orientation_lock', models.CharField(choices=[('auto', 'Auto'), ('portrait', 'Portrait'), ('landscape', 'Landscape')], default='auto', max_length=16)),
|
||||
('theme', models.CharField(choices=[('sepia', 'Sepia'), ('dark', 'Dark'), ('light', 'Light'), ('paper', 'Paper')], default='sepia', max_length=32)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Reading Settings',
|
||||
'verbose_name_plural': 'Reading Settings',
|
||||
'db_table': 'reader_reading_settings',
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user