

@login_required
def edit_group(request, group_id):
    context = {
        
    }
    group = Group.objects.get(pk=group_id)
    if ((not request.user.is_staff) and (request.user.email != group.added_by.email)):
        return HttpResponseRedirect(('/group/%s' % group_id))
    if (request.method == 'POST'):
        form = GroupForm(request.POST, instance=form)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(('/group/%s' % group_id))
    else:
        form = GroupForm(instance=group)
    context['form'] = form
    return r2r(request, 'edit_group', context)

dataset/ETHPy150Open dropbox/questions/questions/views.py edit_group/VarMisuse@95/117 `group`->`form`