From 1e6e033cdda3c715d7feb20521b12c3d674038fd Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 26 Oct 2021 15:07:29 +0200 Subject: [PATCH] Hide borrowable section --- media/admin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/media/admin.py b/media/admin.py index 6496be0..d97238d 100644 --- a/media/admin.py +++ b/media/admin.py @@ -23,7 +23,11 @@ class AuthorAdmin(VersionAdmin): class BorrowableAdmin(PolymorphicParentModelAdmin): search_fields = ('title',) child_models = (CD, Comic, Manga, Novel, Review, Vinyl,) - show_in_index = False + + def get_model_perms(self, request): + # We don't want that the borrowable items appear directly in + # main menu, but we still want search borrowable items. + return {} class MediumAdmin(VersionAdmin, PolymorphicChildModelAdmin):