@@ -606,6 +606,7 @@ class ProjectListView(
606
606
607
607
def get_context_data (self , ** kwargs ):
608
608
context = super ().get_context_data (** kwargs )
609
+ context ["action_form" ] = BaseProjectActionForm ()
609
610
context ["archive_form" ] = ArchiveProjectForm ()
610
611
context ["outputs_download_form" ] = ProjectOutputDownloadForm ()
611
612
context ["report_form" ] = ProjectReportForm ()
@@ -1192,7 +1193,11 @@ def post(self, request, *args, **kwargs):
1192
1193
raise Http404
1193
1194
1194
1195
action_form = self .get_action_form (action )
1195
- selected_project_ids = request .POST .get ("selected_ids" , "" ).split ("," )
1196
+ selected_project_ids = [
1197
+ project_uuid
1198
+ for project_uuid in request .POST .get ("selected_ids" , "" ).split ("," )
1199
+ if project_uuid
1200
+ ]
1196
1201
project_qs = self .get_project_queryset (selected_project_ids , action_form )
1197
1202
1198
1203
if action == "download" :
@@ -1259,8 +1264,10 @@ def get_project_queryset(selected_project_ids=None, action_form=None):
1259
1264
if project_filterset .is_valid ():
1260
1265
return project_filterset .qs
1261
1266
1262
- selected_project_ids = selected_project_ids or []
1263
- return Project .objects .filter (uuid__in = selected_project_ids )
1267
+ if selected_project_ids :
1268
+ return Project .objects .filter (uuid__in = selected_project_ids )
1269
+
1270
+ raise Http404
1264
1271
1265
1272
def get_export_xlsx_queryset (self ):
1266
1273
model_name = self .action_form .cleaned_data ["model_name" ]
0 commit comments