def process_edit(self, **kwargs): """ Updates a group (changes name). """ form = GroupEditForm(request_params()) if form.validate(): (group, modified) = groups.modify(form.group_id.data, name=form.name.data) auditlog.log(auditlog.CODE_CONTENT_MOD, target=group, attributes_modified=modified) notify_entity_activity(group, 'updated') raise cherrypy.HTTPRedirect('/group/list') else: return render('group/edit.html', {'form': form})
def modifyGroup(self, group_id, name): """ Modify (rename) a group. :param group_id: The ID of group to modify. :type group_id: int :keyword name: The new name of the group. :type name: str :return: The updated group object. :rtype: dict """ (group, modified) = groups.modify(group_id, name=name) auditlog.log(auditlog.CODE_CONTENT_MOD, target=group, attributes_modified=modified) return group.to_dict()