Bug 11570 - get_last_build_id not called correctly
Summary: get_last_build_id not called correctly
Status: RESOLVED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 2.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.4 M1
Assignee: David Reyna
QA Contact: Libertad
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-05-24 04:39 UTC by David Reyna
Modified: 2017-06-24 05:11 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Reyna 2017-05-24 04:39:55 UTC
The method "get_last_build_id" is misused in several instances where the "()" is missing. While this is wrong it has not been crashing the code with Django 1.8. However, it does intermittently crash with Django 1.9.

Here is an example problem and fix (toastergui/models.py):

     def get_last_outcome(self):
-        build_id = self.get_last_build_id
+        build_id = self.get_last_build_id()
         if (-1 == build_id):
             return( "" )

Observe that by assigning the function itself to "build_id" that will never be equal to -1.