comparison mod_adhoc_groups/mod_adhoc_groups.lua @ 4031:b2a6e163a6b4

mod_adhoc_groups: Fix check for error on group creation
author Kim Alvefur <zash@zash.se>
date Wed, 20 May 2020 17:24:57 +0200
parents 0d7293c37e1a
children
comparison
equal deleted inserted replaced
4030:0d7293c37e1a 4031:b2a6e163a6b4
88 return false, "Problem in submitted form"; 88 return false, "Problem in submitted form";
89 end 89 end
90 90
91 local group, err = groups:get(fields.group); 91 local group, err = groups:get(fields.group);
92 if group then 92 if group then
93 if err then 93 return false, "That group already exists";
94 return false, "An error occurred on the server. Please try again later."; 94 elseif err then
95 else 95 return false, "An error occurred on the server. Please try again later.";
96 return false, "That group already exists";
97 end
98 end 96 end
99 97
100 if not groups:set(fields.group, { [user] = true }) then 98 if not groups:set(fields.group, { [user] = true }) then
101 return false, "An error occurred while creating the group"; 99 return false, "An error occurred while creating the group";
102 end 100 end