@login_required
def delete_group(request, group_id):
    context = {}
    group = Group.objects.get(pk=group_id)
    if request.user.is_staff or request.user.email == group.added_by.email:
        group.delete()
    return HttpResponseRedirect("/groups")
dataset/ETHPy150Open dropbox/questions/questions/views.py/delete_group/original