@@ -148,17 +148,6 @@ def queryset(self, request, queryset):
148
148
return queryset .filter (tags = v )
149
149
150
150
151
- def mtypes_choices ():
152
- return itertools .chain ((('' , '----' ), ), ((x .pk , x .label ) for x in MemberType .objects .all ()))
153
-
154
-
155
- class MembershipApplicationsForm (admin .helpers .ActionForm ):
156
- mtypes = forms .MultipleChoiceField (
157
- label = _ ("Membership types" ), # TODO: Read from the member model meta ?
158
- choices = lazy (mtypes_choices , tuple )
159
- )
160
-
161
-
162
151
class MembershipApplicationAdmin (VersionAdmin ):
163
152
list_display = (
164
153
'rname' ,
@@ -167,23 +156,12 @@ class MembershipApplicationAdmin(VersionAdmin):
167
156
'tags_formatted' ,
168
157
)
169
158
list_filter = (TagListFilter ,)
170
- actions = ['approve_selected' ]
171
- action_form = MembershipApplicationsForm
172
159
search_fields = ['lname' , 'fname' , 'email' , 'nick' ]
173
160
174
161
def tags_formatted (self , obj ):
175
162
return ', ' .join ((x .label for x in obj .tags .all ()))
176
163
tags_formatted .short_description = _ ("Tags" )
177
164
178
- def approve_selected (modeladmin , request , queryset ):
179
- add_types = []
180
- for x in request .POST .getlist ('mtypes' ):
181
- if x :
182
- add_types .append (int (x ))
183
- for a in queryset .all ():
184
- a .approve (add_types )
185
- approve_selected .short_description = _ ("Approve selected applications" )
186
-
187
165
188
166
class MembershipApplicationTagAdmin (VersionAdmin ):
189
167
pass
0 commit comments