def delete_invite(request, invite_pk):
 invite = get_object_or_404(Invite, pk=invite_pk)
 group = invite.group
 if (group.curators.filter(id=request.user.userprofile.id).exists() or request.user.userprofile.is_manager):
  redeemer = invite.redeemer
  invite.delete()
  notify_redeemer_invitation_invalid.delay(redeemer.pk, group.pk)
  msg = _(u'The invitation to {0} has been successfully revoked.').format(redeemer)
  messages.success(request, msg)
  next_section = request.GET.get('next')
  next_url = urlparams(reverse('groups:group_edit', args=[group.url]), next_section)
  return HttpResponseRedirect(next_url)
 raise Http404()

def delete_invite ( request , invite_pk ) : invite = get_object_or_404 ( Invite , pk = invite_pk ) group = invite . group if ( group . curators . filter ( id = request . user . userprofile . id ) . exists ( ) or request . user . userprofile . is_manager ) : redeemer = invite . redeemer invite . delete ( ) notify_redeemer_invitation_invalid . delay ( redeemer . pk , group . pk ) msg = _ ( u'The invitation to {0} has been successfully revoked.' ) . format ( redeemer ) messages . success ( request , msg ) next_section = request . GET . get ( 'next' ) next_url = urlparams ( reverse ( 'groups:group_edit' , args = [ group . url ] ) , next_section ) return HttpResponseRedirect ( next_url ) raise Http404 ( )
delete an invite to join a group .