Skip to content

Commit

Permalink
Set default roles as list
Browse files Browse the repository at this point in the history
This prevents '"Manager" in roles' breaking if roles was missing
  • Loading branch information
wesleybl committed Nov 1, 2023
1 parent a94d9f6 commit 36b8a90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plone/restapi/services/groups/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def reply(self):
if not groupname:
raise BadRequest("Property 'groupname' is required")

roles = data.get("roles", None)
roles = data.get("roles", [])

if not self.is_zope_manager and "Manager" in roles:
raise BadRequest(
Expand Down

0 comments on commit 36b8a90

Please sign in to comment.