Skip to content

Commit

Permalink
client: convert bools and skip non-str
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Apr 8, 2024
1 parent 51b2f3b commit 13a2f9a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions mpcontribs-client/mpcontribs/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2163,9 +2163,19 @@ def submit_contributions(
):
continue

contribs[project_name].append(
{k: deepcopy(contrib[k]) for k in fields if k in contrib}
)
contrib_copy = {}
for k in fields:
if k in contrib:
flat = {}
for kk, vv in flatten(contrib[k], reducer="dot").items():
if isinstance(vv, bool):
flat[kk] = "Yes" if vv else "No"
elif isinstance(vv, str):
flat[kk] = vv

contrib_copy[k] = deepcopy(unflatten(flat, splitter="dot"))

contribs[project_name].append(contrib_copy)

for component in COMPONENTS:
elements = contrib.get(component, [])
Expand Down

0 comments on commit 13a2f9a

Please sign in to comment.