# HG changeset patch # User Matthew Wild # Date 1611088463 0 # Node ID a49ca492e621a1e2b327b4d35f36a2e2f1000f18 # Parent ab2e15d3f1fa1dfa81f3f2fa78dc550fcadd1878 mod_invites, mod_http_admin_api: Allow specifying multiple groups when creating an invite diff -r ab2e15d3f1fa -r a49ca492e621 mod_http_admin_api/mod_http_admin_api.lua --- a/mod_http_admin_api/mod_http_admin_api.lua Mon Jan 18 20:01:17 2021 +0100 +++ b/mod_http_admin_api/mod_http_admin_api.lua Tue Jan 19 20:34:23 2021 +0000 @@ -116,13 +116,13 @@ local invite; if invite_options and invite_options.reusable then - invite = invites.create_group(invite_options.group, invite_options.ttl, { + invite = invites.create_group(invite_options.groups, invite_options.ttl, { source = "admin_api/"..event.session.username; }); else invite = invites.create_account(nil, { source = "admin_api/"..event.session.username; - groups = { invite_options.group }; + groups = invite_options.groups; }); end if not invite then diff -r ab2e15d3f1fa -r a49ca492e621 mod_invites/mod_invites.lua --- a/mod_invites/mod_invites.lua Mon Jan 18 20:01:17 2021 +0100 +++ b/mod_invites/mod_invites.lua Tue Jan 19 20:34:23 2021 +0000 @@ -84,9 +84,9 @@ -- Create invitation to register an account and join a user group -- If explicit ttl is passed, invite is valid for multiple signups -- during that time period -function create_group(group_id, ttl, additional_data) --luacheck: ignore 131/create_group +function create_group(group_ids, ttl, additional_data) --luacheck: ignore 131/create_group local merged_additional_data = { - groups = { group_id }; + groups = group_ids; }; if merged_additional_data then for k, v in pairs(additional_data) do