def edit_group(request, group_id): group = get_object_or_404(Group, pk=group_id) form = GroupForm(request.POST, instance=group) if not form.is_valid(): raise FormException(form) form.save()
def add_group(request): form = GroupForm(request.POST) if not form.is_valid(): raise FormException(form) form.save()