Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #105 from praekelt/remove-construct_main_menu
Browse files Browse the repository at this point in the history
remove showing surveys entries for specific groups
  • Loading branch information
Saeed Marzban committed Jun 6, 2018
2 parents 95b53f7 + c0a6bf7 commit abf60ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 6 additions & 0 deletions local_test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
CELERY_ALWAYS_EAGER = True
BROKER_BACKEND = 'memory'

ALLOWED_HOSTS = [
'localhost',
'.localhost',
'site2',
]

PERSONALISATION_SEGMENTS_ADAPTER = (
'molo.surveys.adapters.PersistentSurveysSegmentsAdapter'
)
9 changes: 0 additions & 9 deletions molo/surveys/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.conf import settings
from django.conf.urls import include, url
from django.utils.html import format_html_join
from django.contrib.auth.models import User

from wagtail.contrib.modeladmin.options import modeladmin_register
from wagtail.wagtailcore import hooks
Expand All @@ -16,14 +15,6 @@
modeladmin_register(SegmentUserGroupAdmin)


@hooks.register('construct_main_menu')
def show_surveys_entries_for_users_have_access(request, menu_items):
if not request.user.is_superuser and not User.objects.filter(
pk=request.user.pk, groups__name='Moderators').exists():
menu_items[:] = [
item for item in menu_items if item.name != 'surveys']


@hooks.register('insert_global_admin_js')
def global_admin_js():
js_files = [
Expand Down

0 comments on commit abf60ca

Please sign in to comment.