def remove_team(request, team): if not can_remove_team(request.user, team): return HttpResponseRedirect(reverse('sentry')) if request.method == 'POST': form = RemoveTeamForm(request.POST) else: form = RemoveTeamForm() if form.is_valid(): team.delete() messages.add_message( request, messages.SUCCESS, _(u'The team %r was permanently deleted.') % (team.name.encode('utf-8'), )) return HttpResponseRedirect(reverse('sentry')) context = csrf(request) context.update({ 'page': 'settings', 'form': form, 'SUBSECTION': 'settings', }) return render_with_team_context(team, 'sentry/teams/remove.html', context, request)
def remove_team(request, team): if not can_remove_team(request.user, team): return HttpResponseRedirect(reverse('sentry')) if request.method == 'POST': form = RemoveTeamForm(request.POST) else: form = RemoveTeamForm() if form.is_valid(): if team.status == TeamStatus.VISIBLE: team.update(status=TeamStatus.PENDING_DELETION) # we delay the task for 5 minutes so we can implement an undo kwargs = {'object_id': team.id} delete_team.apply_async(kwargs=kwargs, countdown=60 * 5) messages.add_message( request, messages.SUCCESS, _('Deletion has been queued and will happen automatically.')) return HttpResponseRedirect(reverse('sentry')) context = csrf(request) context.update({ 'page': 'settings', 'form': form, 'SUBSECTION': 'settings', }) return render_with_team_context(team, 'sentry/teams/remove.html', context, request)
def remove_team(request, team): if not can_remove_team(request.user, team): return HttpResponseRedirect(reverse("sentry")) form = RemoveTeamForm(request.POST or None) if form.is_valid(): team.delete() return HttpResponseRedirect(reverse("sentry-team-list")) context = csrf(request) context.update({"page": "settings", "form": form, "team": team}) return render_to_response("sentry/teams/remove.html", context, request)
def remove_team(request, team): if not can_remove_team(request.user, team): return HttpResponseRedirect(reverse('sentry')) form = RemoveTeamForm(request.POST or None) if form.is_valid(): team.delete() return HttpResponseRedirect(reverse('sentry-team-list')) context = csrf(request) context.update({ 'form': form, 'team': team, }) return render_to_response('sentry/teams/remove.html', context, request)
def remove_team(request, team): if not can_remove_team(request.user, team): return HttpResponseRedirect(reverse('sentry')) if request.method == 'POST': form = RemoveTeamForm(request.POST) else: form = RemoveTeamForm() if form.is_valid(): team.delete() return HttpResponseRedirect(reverse('sentry-team-list')) context = csrf(request) context.update({ 'page': 'settings', 'form': form, 'SUBSECTION': 'settings', }) return render_with_team_context(team, 'sentry/teams/remove.html', context, request)
def remove_team(request, team): if not can_remove_team(request.user, team): return HttpResponseRedirect(reverse('sentry')) if request.method == 'POST': form = RemoveTeamForm(request.POST) else: form = RemoveTeamForm() if form.is_valid(): team.delete() messages.add_message( request, messages.SUCCESS, _(u'The team %r was permanently deleted.') % (team.name.encode('utf-8'),)) return HttpResponseRedirect(reverse('sentry')) context = csrf(request) context.update({ 'page': 'settings', 'form': form, 'SUBSECTION': 'settings', }) return render_with_team_context(team, 'sentry/teams/remove.html', context, request)