mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #4968: Fix exception when activating user keys in admin UI
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from django.contrib import admin, messages
|
||||
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
|
||||
from django.shortcuts import redirect, render
|
||||
|
||||
from .forms import ActivateUserKeyForm
|
||||
@ -50,7 +51,9 @@ class UserKeyAdmin(admin.ModelAdmin):
|
||||
request, "Invalid private key provided. Unable to retrieve master key.", extra_tags='error'
|
||||
)
|
||||
else:
|
||||
form = ActivateUserKeyForm(initial={'_selected_action': request.POST.getlist(admin.ACTION_CHECKBOX_NAME)})
|
||||
form = ActivateUserKeyForm(
|
||||
initial={'_selected_action': request.POST.getlist(ACTION_CHECKBOX_NAME)}
|
||||
)
|
||||
|
||||
return render(request, 'activate_keys.html', {
|
||||
'form': form,
|
||||
|
Reference in New Issue
Block a user