Skip to content

fix: handle missing selected user ids in bulk permissions - #3161

Open
xeseing wants to merge 1 commit into
Open-MSS:developfrom
xeseing:fix-bulk-permission-userids-default
Open

fix: handle missing selected user ids in bulk permissions#3161
xeseing wants to merge 1 commit into
Open-MSS:developfrom
xeseing:fix-bulk-permission-userids-default

Conversation

@xeseing

@xeseing xeseing commented Aug 4, 2026

Copy link
Copy Markdown

Description

Fixes the default value used when parsing selected_userids in bulk permission routes.

Changes

  • Updated add_bulk_permissions to default missing selected_userids to "[]"
  • Updated modify_bulk_permissions to default missing selected_userids to "[]"
  • Updated delete_bulk_permissions to default missing selected_userids to "[]"

Why

json.loads() expects a string, bytes, or bytearray. The previous default value was a Python list ([]), which can raise a TypeError if selected_userids is missing from the submitted form data.

Using "[]" keeps the intended empty-list behavior while passing a valid JSON string to json.loads().

Testing

  • Ran python -m py_compile mslib/mscolab/blueprints/operation/__init__.py
  • Reviewed the three bulk permission routes locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant