Looks like the "name" argument comes in both as "group_name" and "name" here. Maybe g.pop("name"} instead? Seems kind of messy to have the argument passed in twice.