mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-06-27 16:57:01 +00:00
Check if user is authenticated before loading user_acl
This commit is contained in:
parent
a58d233546
commit
701f957642
@ -3,9 +3,10 @@ from .models import WireGuardInstance
|
||||
|
||||
|
||||
def pending_changes_warning(request):
|
||||
user_acl = UserAcl.objects.filter(user=request.user).first()
|
||||
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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user