From ea9d381a2e4ed8b27eb5cd13f522455138cf6b1f Mon Sep 17 00:00:00 2001
From: "a.croix" <croix.alexandre@gmail.com>
Date: Thu, 20 May 2021 14:09:35 +0200
Subject: [PATCH] Update getJobProgression to avoid error

---
 app/Log.php                          | 4 +---
 resources/views/wowa/index.blade.php | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/app/Log.php b/app/Log.php
index ee59cbc..8cd45b7 100644
--- a/app/Log.php
+++ b/app/Log.php
@@ -4,7 +4,6 @@
 namespace App;
 
 use Illuminate\Database\Eloquent\Model;
-use Illuminate\Support\Facades\DB;
 
 class Log extends Model
 {
@@ -17,8 +16,7 @@ class Log extends Model
         $logs =  self::where('job_id', '=', $wowa->id)->orderBy('progression', 'desc')->first();
         if (!is_object($logs)) {
             return "Calculation in progress...";
-        }
-        if ($wowa->status == Wowa::STATE_COLLECTION) {
+        } elseif ($wowa->status == Wowa::STATE_COLLECTION) {
             $log = self::where('job_id', '=', $wowa->id)
                 ->where('training', '=', false)->orderBy('progression', 'desc')->first();
             return $log->progression;
diff --git a/resources/views/wowa/index.blade.php b/resources/views/wowa/index.blade.php
index 082d6db..67a7e6e 100644
--- a/resources/views/wowa/index.blade.php
+++ b/resources/views/wowa/index.blade.php
@@ -20,7 +20,7 @@
             <th>User</th>
             <th>Score</th>
             <th>Status</th>
-            <th>Progression</th>
+            <th>Progression (%)</th>
             <th></th>
         </tr>
         @foreach($wowas as $wowa)
-- 
GitLab