Skip to content

Commit 1a79b48

Browse files
authored
backups: allow updating a failed backup (pterodactyl#3470)
1 parent 4a4af7d commit 1a79b48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Http/Controllers/Api/Remote/Backups/BackupStatusController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function index(ReportBackupCompleteRequest $request, string $backup)
4242
/** @var \Pterodactyl\Models\Backup $model */
4343
$model = Backup::query()->where('uuid', $backup)->firstOrFail();
4444

45-
if (!is_null($model->completed_at)) {
45+
if ($model->is_successful) {
4646
throw new BadRequestHttpException('Cannot update the status of a backup that is already marked as completed.');
4747
}
4848

@@ -54,7 +54,7 @@ public function index(ReportBackupCompleteRequest $request, string $backup)
5454
$audit->is_system = true;
5555
$audit->metadata = ['backup_uuid' => $model->uuid];
5656

57-
$successful = $request->input('successful') ? true : false;
57+
$successful = $request->boolean('successful');
5858
$model->fill([
5959
'is_successful' => $successful,
6060
// Change the lock state to unlocked if this was a failed backup so that it can be

0 commit comments

Comments
 (0)