Replaced all object-specific BulkDeleteForms with the stock form provided by utilities.BulkDeleteView
This commit is contained in:
@@ -5,7 +5,7 @@ from django import forms
|
||||
from django.db.models import Count
|
||||
|
||||
from dcim.models import Device
|
||||
from utilities.forms import BootstrapMixin, BulkImportForm, ConfirmationForm, CSVDataField, SlugField
|
||||
from utilities.forms import BootstrapMixin, BulkImportForm, CSVDataField, SlugField
|
||||
|
||||
from .models import Secret, SecretRole, UserKey
|
||||
|
||||
@@ -42,10 +42,6 @@ class SecretRoleForm(forms.ModelForm, BootstrapMixin):
|
||||
fields = ['name', 'slug']
|
||||
|
||||
|
||||
class SecretRoleBulkDeleteForm(ConfirmationForm):
|
||||
pk = forms.ModelMultipleChoiceField(queryset=SecretRole.objects.all(), widget=forms.MultipleHiddenInput)
|
||||
|
||||
|
||||
#
|
||||
# Secrets
|
||||
#
|
||||
@@ -97,10 +93,6 @@ class SecretBulkEditForm(forms.Form, BootstrapMixin):
|
||||
name = forms.CharField(max_length=100, required=False)
|
||||
|
||||
|
||||
class SecretBulkDeleteForm(ConfirmationForm):
|
||||
pk = forms.ModelMultipleChoiceField(queryset=Secret.objects.all(), widget=forms.MultipleHiddenInput)
|
||||
|
||||
|
||||
def secret_role_choices():
|
||||
role_choices = SecretRole.objects.annotate(secret_count=Count('secrets'))
|
||||
return [(r.slug, u'{} ({})'.format(r.name, r.secret_count)) for r in role_choices]
|
||||
|
Reference in New Issue
Block a user