diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2020-02-28 20:47:07 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2020-02-28 20:47:07 +0800 |
commit | 51a75a3e5027f493181dc693b96e76052e2c0fec (patch) | |
tree | 8fb0d1f62638e7c19306193793ec73c5be28a9a8 | |
parent | 62f54c1a6a630daba4238e3d72176703a268ddd8 (diff) |
lkft/views.py: fix error that not pass the db objects
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | lkft/views.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lkft/views.py b/lkft/views.py index 5f667fc..900a3b7 100644 --- a/lkft/views.py +++ b/lkft/views.py @@ -1310,10 +1310,10 @@ def list_kernel_changes(request): db_kernelchanges = KernelChange.objects.all().order_by('branch', '-describe') check_branches = [] for db_kernelchange in db_kernelchanges: - if db_kernelchange.branch in check_branches: + if db_kernelchange in check_branches: continue else: - check_branches.append(db_kernelchange.branch) + check_branches.append(db_kernelchange) kernelchanges = get_kernel_changes_info(db_kernelchanges=check_branches) @@ -1369,7 +1369,9 @@ def list_describe_kernel_changes(request, branch, describe): report_build['number_total'] = db_report_build.number_total report_build['modules_done'] = db_report_build.modules_done report_build['modules_total'] = db_report_build.modules_total - report_build['duration'] = db_report_build.fetched_at - db_report_build.started_at + if db_report_build.fetched_at and db_report_build.started_at: + report_build['duration'] = db_report_build.fetched_at - db_report_build.started_at + report_builds.append(report_build) return render(request, 'lkft-describe.html', |