13 lines
341 B
Python
13 lines
341 B
Python
from django.db.models import Q
|
|
|
|
from .models import SharingPreferences
|
|
|
|
|
|
def sharing_navigation(request):
|
|
return {
|
|
"show_shared_inventory": request.user.is_authenticated
|
|
and SharingPreferences.objects.filter(owner__is_active=True)
|
|
.filter(Q(share_inventory=True) | Q(share_printers=True))
|
|
.exists()
|
|
}
|