mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-08-02 17:24:43 +02:00
Add pending changes warning context processor
This commit is contained in:
parent
fdc941726c
commit
2b8ec3ac88
6 changed files with 51 additions and 71 deletions
9
wireguard/context_processors.py
Normal file
9
wireguard/context_processors.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
from .models import WireGuardInstance
|
||||
|
||||
|
||||
def pending_changes_warning(request):
|
||||
if request.user.is_authenticated:
|
||||
pending = WireGuardInstance.objects.filter(pending_changes=True).exists()
|
||||
else:
|
||||
pending = False
|
||||
return {'pending_changes_warning': pending}
|
Loading…
Add table
Add a link
Reference in a new issue