make empty descriptions on tracker edit work

it's possible to create a tracker with an empty description, but not
edit a tracker to have an empty description.

the rewrite lambda turns empty strings into None, resulting in
descriptions being never updated if it's empty.
This commit is contained in:
Jackson Chen 2023-09-24 21:13:57 +02:00 committed by Drew DeVault
parent 4c4e19a958
commit a297b4254d
1 changed files with 1 additions and 2 deletions

View File

@ -62,9 +62,8 @@ def details_POST(owner, name):
abort(403)
valid = Validation(request)
rewrite = lambda value: None if value == "" else value
input = {
key: rewrite(valid.source[key]) for key in [
key: valid.source[key] for key in [
"description", "visibility",
] if valid.source.get(key) is not None
}