fix: bug with comparison regarding None values and empty string

In their default state, the fields can be `None`. When a user enters something and deletes it afterwards, the fields contain an empty string.

This fixes the comparison.

(cherry picked from commit 3fd5a0f100)
This commit is contained in:
Markus Lobedann
2026-02-17 12:46:30 +01:00
committed by Mergify
parent 10be8f19e2
commit 66d1b7c837

View File

@@ -278,7 +278,9 @@ class QualityInspection(Document):
def set_status_based_on_acceptance_values(self, reading):
if not cint(reading.numeric):
result = reading.get("reading_value") == reading.get("value")
reading_value = reading.get("reading_value") or ""
value = reading.get("value") or ""
result = reading_value == value
else:
# numeric readings
result = self.min_max_criteria_passed(reading)