Case-insensitive group name to ID translation

Seems Discourse won't let you create `Group` if `group` already exists (`422 Name has already been taken`).

Thanks @huberfe
This commit is contained in:
Adarnof 2017-11-17 13:07:41 -05:00
parent 4f5fc18c66
commit 995a44de0a

View File

@ -213,7 +213,7 @@ class DiscourseManager:
def get_or_create_group():
groups = DiscourseManager._get_groups()
for g in groups:
if g['name'] == name:
if g['name'].lower() == name.lower():
return g['id']
return DiscourseManager._create_group(name)['id']