mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-04-19 08:55:12 +00:00
13 lines
435 B
Python
13 lines
435 B
Python
from user_manager.models import UserAcl
|
|
from .models import WireGuardInstance
|
|
|
|
|
|
def pending_changes_warning(request):
|
|
if request.user.is_authenticated:
|
|
user_acl = UserAcl.objects.filter(user=request.user).first()
|
|
pending = WireGuardInstance.objects.filter(pending_changes=True).exists()
|
|
else:
|
|
user_acl = None
|
|
pending = False
|
|
return {'pending_changes_warning': pending, 'user_acl': user_acl}
|