You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when checking the code for get_pages_with_reviews_for_user():
@classmethoddefget_pages_with_reviews_for_user(cls, user):
""" Return a queryset of pages which have reviews, for which the user has edit permission """user_perms=UserPagePermissionsProxy(user)
reviewed_pages= (
cls.objects
.order_by('-created_at')
.values_list('page_revision__page_id', 'created_at')
)
# Annotate datetime when a review was last created for this pagelast_review_requested_at=Case(
*[
When(pk=pk, then=Value(created_at))
forpk, created_atinreviewed_pages
],
output_field=models.DateTimeField(),
)
return (
user_perms.editable_pages()
.filter(pk__in=(page[0] forpageinreviewed_pages))
.annotate(last_review_requested_at=last_review_requested_at)
.order_by('-last_review_requested_at')
)
as you remark if we have many pages which is my case this loop is causing problems loading any page in the application with menu_items
to resolve this problem for the moment I was pushed to delete the hook through this command(because hiding the menu_item is not resolving the problem as the hook is always have been called):
sed -i "s/register_admin_menu_item//g" /usr/local/lib/python3.8/site-packages/wagtail_review/wagtail_hooks.py
my question is there any way to cancel showing the menu item with a more proper way?
thank you
The text was updated successfully, but these errors were encountered:
the review menu which is being initiated through this code in
wagtail_hooks.py
when checking the code for
get_pages_with_reviews_for_user()
:as you remark if we have many pages which is my case this loop is causing problems loading any page in the application with menu_items
to resolve this problem for the moment I was pushed to delete the hook through this command(because hiding the menu_item is not resolving the problem as the hook is always have been called):
sed -i "s/register_admin_menu_item//g" /usr/local/lib/python3.8/site-packages/wagtail_review/wagtail_hooks.py
my question is there any way to cancel showing the menu item with a more proper way?
thank you
The text was updated successfully, but these errors were encountered: