diff roundup/rest.py @ 8530:36be91f671d0

bug: fix case where null json value for datetime fails Json like: { "assignedto": "3", "duedate": null, "files": [], "keyword": [], "messages": [ "4", "13" ], "nosy": [], "priority": "2", "status": "3", "superseder": [], "title": "issue title" } is produced by a GET request using verbose=0. When submitted to the rest interface results in: property duedate: 'None' is an invalid date (Not a date spec: 'None' ("yyyy-mm-dd", "mm-dd", "HH:MM", "HH:MM:SS" or "yyyy-mm-dd.HH:MM:SS.SSS" Fix FsValue to map null to the None object rather than 'None' string.
author John Rouillard <rouilj@ieee.org>
date Sat, 07 Mar 2026 19:25:22 -0500
parents 224ccb8b49ca
children 1f8492d68aca
line wrap: on
line diff
--- a/roundup/rest.py	Sun Mar 01 21:39:44 2026 -0500
+++ b/roundup/rest.py	Sat Mar 07 19:25:22 2026 -0500
@@ -2782,6 +2782,8 @@
             elif isinstance(val, type([])):
                 # then lists of strings
                 self.value = [u2s(v) for v in val]
+            elif val is None:
+                self.value = None
             else:
                 # then stringify anything else (int, float)
                 self.value = str(val)

Roundup Issue Tracker: http://roundup-tracker.org/