File tree Expand file tree Collapse file tree
static/riot/competitions/detail Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -536,9 +536,10 @@ def soft_delete(self):
536536 detail .delete () # Remove record from DB
537537
538538 # Clear the data field if no other submissions are using it
539- other_submissions_using_data = Submission .objects .filter (data = self .data ).exclude (pk = self .pk ).exists ()
540- if not other_submissions_using_data :
541- self .data .delete ()
539+ if self .data :
540+ other_submissions_using_data = Submission .objects .filter (data = self .data ).exclude (pk = self .pk ).exists ()
541+ if not other_submissions_using_data :
542+ self .data .delete ()
542543
543544 # Clear the data field for this submission
544545 self .data = None
@@ -554,11 +555,12 @@ def soft_delete(self):
554555 def delete (self , ** kwargs ):
555556
556557 # Check if any other submissions are using the same data
557- other_submissions_using_data = Submission .objects .filter (data = self .data ).exclude (pk = self .pk ).exists ()
558+ if self .data :
559+ other_submissions_using_data = Submission .objects .filter (data = self .data ).exclude (pk = self .pk ).exists ()
558560
559- if not other_submissions_using_data :
560- # If no other submissions are using the same data, delete it
561- self .data .delete ()
561+ if not other_submissions_using_data :
562+ # If no other submissions are using the same data, delete it
563+ self .data .delete ()
562564
563565 # Also clean up details on delete
564566 self .details .all ().delete ()
Original file line number Diff line number Diff line change 123123 </a>
124124 </td>
125125 <!-- Show Action buttons when submission is not soft deleted -->
126- <!-- Otherwise show empty <td> -->
127- <td if="{ submission.is_soft_deleted }"></td>
126+ <!-- For soft-deleted submissions, organizers can still hard-delete -->
127+ <td if="{ submission.is_soft_deleted }">
128+ <virtual if="{ opts.admin }">
129+ <span data-tooltip="Delete Submission" data-inverted=""
130+ onclick="{ delete_submission.bind(this, submission) }">
131+ <i class="icon red trash alternate"></i>
132+ </span>
133+ </virtual>
134+ </td>
128135 <td class="center aligned" if="{ !submission.is_soft_deleted }">
129136 <virtual if="{ opts.admin}">
130137 <!-- run/rerun submission -->
You can’t perform that action at this time.
0 commit comments