Skip to content

Commit

Permalink
Subjects page filtering unlisted books
Browse files Browse the repository at this point in the history
  • Loading branch information
edwoodward committed Oct 30, 2023
1 parent e7af18e commit 3062528
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
18 changes: 18 additions & 0 deletions books/migrations/0149_alter_book_book_state.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.1.7 on 2023-10-30 15:19

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('books', '0148_book_book_uuid_alter_book_cnx_id'),
]

operations = [
migrations.AlterField(
model_name='book',
name='book_state',
field=models.CharField(choices=[('live', 'Live'), ('coming_soon', 'Coming Soon'), ('new_edition_available', 'New Edition Forthcoming (Show new edition correction schedule)'), ('deprecated', 'Deprecated (Disallow errata submissions and show deprecated schedule)'), ('retired', 'Retired (Remove from website)'), ('unlisted', 'Unlisted (Not included in books sent to site)')], default='live', help_text='The state of the book.', max_length=255),
),
]
2 changes: 1 addition & 1 deletion pages/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2739,7 +2739,7 @@ def subjects(self):
for book in all_books:
if book.subject_categories is not None \
and category.subject_category in book.subject_categories \
and book.book_state != 'retired':
and book.book_state not in ['retired', 'unlisted']:
book_data = []
book_data.append({
'id': book.id,
Expand Down
18 changes: 18 additions & 0 deletions snippets/migrations/0030_alter_erratacontent_book_state.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.1.7 on 2023-10-30 15:19

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('snippets', '0029_assignableavailable'),
]

operations = [
migrations.AlterField(
model_name='erratacontent',
name='book_state',
field=models.CharField(choices=[('live', 'Live'), ('coming_soon', 'Coming Soon'), ('new_edition_available', 'New Edition Forthcoming (Show new edition correction schedule)'), ('deprecated', 'Deprecated (Disallow errata submissions and show deprecated schedule)'), ('retired', 'Retired (Remove from website)'), ('unlisted', 'Unlisted (Not included in books sent to site)')], default='live', help_text='The state of the book.', max_length=255),
),
]

0 comments on commit 3062528

Please sign in to comment.