Skip to content

Commit

Permalink
Started adding unlisted book state
Browse files Browse the repository at this point in the history
  • Loading branch information
edwoodward committed Oct 25, 2023
1 parent 80e330e commit e7af18e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion books/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
NEW_EDITION_AVAILABLE = 'new_edition_available'
DEPRECATED = 'deprecated'
RETIRED = 'retired'
UNLISTED = 'unlisted'
BOOK_STATES = (
(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)')
(RETIRED, 'Retired (Remove from website)'),
(UNLISTED, 'Unlisted (Not included in books sent to site)')
)

YELLOW = 'yellow'
Expand Down
2 changes: 1 addition & 1 deletion books/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ class BookIndex(Page):

@property
def books(self):
books = Book.objects.live().filter(locale=self.locale).order_by('title')
books = Book.objects.live().filter(locale=self.locale).filter(self.book_state is not 'unlisted').order_by('title')
book_data = []
for book in books:
has_faculty_resources = BookFacultyResources.objects.filter(book_faculty_resource=book).exists()
Expand Down

0 comments on commit e7af18e

Please sign in to comment.