Skip to content

Commit 9218b27

Browse files
Jeffjagerman
authored andcommitted
respect none value
1 parent c6ab8c2 commit 9218b27

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sogs/model/room.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ def future_permissions(self):
15471547
continue
15481548
if k in ('at', 'session_id'):
15491549
data[k] = row[k]
1550-
else:
1550+
elif row[k] is not None:
15511551
data[k] = bool(row[k])
15521552
ret.append(data)
15531553
return ret

sogs/routes/rooms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ def get_permission_info(room):
312312
if compact is set to 1 this will be a string,
313313
otherwise it will be a dict containing the name of the permission mapped to a boolean value.
314314
"""
315-
transform = lambda x: x # noqa: E731
315+
perms = room.permissions
316316
if request.args.get("compact", type=int, default=0):
317-
transform = compact_permissions
318-
return jsonify(transform(room.permissions))
317+
perms = {key: compact_permissions(perms[key]) for key in perms}
318+
return jsonify(perms)
319319

320320

321321
@rooms.get("/room/<Room:room>/futurePermInfo")

0 commit comments

Comments
 (0)