symposion_app/symposion_project/apps/cms/context_processors.py

11 lines
240 B
Python
Raw Normal View History

from cms.models import MenuItem
def menuitems(request):
qs = MenuItem.objects.filter(published=True)
if not request.user.is_authenticated():
qs = qs.filter(login_required=False)
return {
"menuitems": qs,
}