From 071211ea1e0877e9b6ba7b3b1a917b4e21e29fc7 Mon Sep 17 00:00:00 2001 From: Ilmari Marttila Date: Tue, 19 Nov 2024 14:23:11 +0200 Subject: [PATCH] Different types are not orderable in Python 3 --- web/tupa/TehtavanMaaritys.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/tupa/TehtavanMaaritys.py b/web/tupa/TehtavanMaaritys.py index 86de3da9..67f4707d 100644 --- a/web/tupa/TehtavanMaaritys.py +++ b/web/tupa/TehtavanMaaritys.py @@ -1239,7 +1239,7 @@ def tallennaTehtavaData(data): osa_tehtava.id = ot_k osa_tehtava.tehtava = tehtava - if osa_tehtava.id > 0 or osa_tehtava.id == None: + if osa_tehtava.id is None or osa_tehtava.id > 0: osa_tehtava.save() if "parametrit" in ot_v.keys(): for p_k, p_v in ot_v["parametrit"].items(): @@ -1250,7 +1250,7 @@ def tallennaTehtavaData(data): if not type(p_k) == str: parametri.id = p_k parametri.osa_tehtava = osa_tehtava - if parametri.id > 0 or parametri.id == None: + if parametri.id is None or parametri.id > 0: parametri.save() else: @@ -1266,7 +1266,7 @@ def tallennaTehtavaData(data): if not type(m_k) == str: maarite.id = m_k maarite.osa_tehtava = osa_tehtava - if maarite.id > 0 or maarite.id == None: + if maarite.id is None or maarite.id > 0: maarite.save() else: maarite.id = -maarite.id