1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

implement dark mode

This commit is contained in:
checktheroads
2021-04-25 20:11:46 -07:00
parent d7d004b48e
commit 2b159fc40f
55 changed files with 1850 additions and 969 deletions

View File

@ -91,6 +91,7 @@ class LogoutView(View):
"""
Deauthenticate a web user.
"""
def get(self, request):
logger = logging.getLogger('netbox.auth.logout')
@ -136,9 +137,17 @@ class UserConfigView(LoginRequiredMixin, View):
data = userconfig.all()
# Delete selected preferences
for key in request.POST.getlist('pk'):
if key in data:
userconfig.clear(key)
if "_delete" in request.POST:
for key in request.POST.getlist('pk'):
if key in data:
userconfig.clear(key)
# Update specific values
elif "_update" in request.POST:
for key in request.POST:
if not key.startswith('_') and not key.contains('csrf'):
for value in request.POST.getlist(key):
userconfig.set(key, value)
userconfig.save()
messages.success(request, "Your preferences have been updated.")