mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-08-26 13:21:14 +00:00
Check if user is authenticated before loading user_acl
This commit is contained in:
@@ -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}
|
||||
|
Reference in New Issue
Block a user