<s> from __future__ import absolute_import , division <EOL> from django . core . urlresolvers import reverse <EOL> from django . http import Http404 , HttpResponseRedirect <EOL> from django . shortcuts import get_object_or_404 <EOL> from sentry . models import Group , GroupMeta <EOL> from sentry . plugins import plugins <EOL> from sentry . web . frontend . base import ProjectView <EOL> class GroupPluginActionView ( ProjectView ) : <EOL> required_scope = '<STR_LIT>' <EOL> def handle ( self , request , organization , team , project , group_id , slug ) : <EOL> group = get_object_or_404 ( Group , pk = group_id , project = project ) <EOL> try : <EOL> plugin = plugins . get ( slug ) <EOL> except KeyError : <EOL> raise Http404 ( '<STR_LIT>' ) <EOL> GroupMeta . objects . populate_cache ( [ group ] ) <EOL> response = plugin . get_view_response ( request , group ) <EOL> if response : <EOL> return response <EOL> redirect = request . META . get ( '<STR_LIT>' ) or reverse ( '<STR_LIT>' , kwargs = { <EOL> '<STR_LIT>' : organization . slug , <EOL> '<STR_LIT>' : group . project . slug <EOL> } ) <EOL> return HttpResponseRedirect ( redirect ) </s>
