Skip to content

Commit

Permalink
Alternate fix to Loomio API bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunagm committed Apr 28, 2022
1 parent 5caa174 commit 752f5e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion metagov/metagov/plugins/loomio/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ def start(self, parameters: Parameters):

payload["options[]"] = parameters.options
payload["api_key"] = api_key
resp = requests.post(url, json=payload)
if parameters.recipient_emails:
payload["recipient_emails[]"] = parameters.recipient_emails
payload.pop("recipient_emails")
if parameters.recipient_user_ids:
payload["recipient_user_ids[]"] = parameters.recipient_user_ids
payload.pop("recipient_user_ids")
resp = requests.post(url, payload)

if not resp.ok:
logger.error(f"Error: {resp.status_code} {resp.text}")
raise PluginErrorInternal(resp.text)
Expand Down

0 comments on commit 752f5e4

Please sign in to comment.