Skip to content

Commit

Permalink
Added more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejmets committed Nov 20, 2024
1 parent b79aece commit 2fba87b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/senaite/timeseries/browser/overrides/analysisrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from bika.lims import api
from bika.lims.browser.analysisrequest.tables import AnalysesView as AV
from bika.lims.utils import get_image
from senaite.core import logger
from senaite.core.api import dtime
from senaite.core.permissions import ViewResults
from senaite.timeseries.config import _
Expand All @@ -28,6 +29,9 @@ def _folder_item_result(self, analysis_brain, item):
obj = self.get_object(analysis_brain)

result = obj.getResult()
logger.info(
"AnalysisRequestOverride::_folder_item_result: result: {}".format(result)
)
capture_date = obj.getResultCaptureDate()
localized_capture_date = dtime.to_localized_time(capture_date, long_format=1)

Expand Down Expand Up @@ -99,12 +103,18 @@ def _folder_item_result(self, analysis_brain, item):
item["time_series_graph_yaxis"] = obj.GraphYAxisTitle

if not result:
logger.info("AnalysisRequestOverride::_folder_item_result: no result")
return

formatted_result = obj.getFormattedResult(
sciformat=int(self.scinot), decimalmark=self.dmk
)
item["formatted_result"] = formatted_result
logger.info(
"AnalysisRequestOverride::_folder_item_result: formatted_result: {}".format(
formatted_result
)
)

def folderitems(self):
# This shouldn't be required here, but there are some views that calls
Expand All @@ -119,6 +129,9 @@ def folderitems(self):
for item in items:
if not item.get("time_series_columns"):
newitems.append(item)
logger.info(
"AnalysisRequestOverride::folderitems: found {} items".format(len(newitems))
)
return newitems


Expand Down
2 changes: 1 addition & 1 deletion src/senaite/timeseries/extenders/abstractbaseanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
(
("float", _("Float")),
("number", _("Number")),
("date", _("Date")),
# ("date", _("Date")),
)
),
},
Expand Down

0 comments on commit 2fba87b

Please sign in to comment.