def get_group_with_redirect(id, queryset=None):
 if (queryset is None):
  queryset = Group.objects.all()
  getter = Group.objects.get_from_cache
 else:
  getter = queryset.get
 try:
  return (getter(id=id), False)
 except Group.DoesNotExist as error:
  from sentry.models import GroupRedirect
  qs = GroupRedirect.objects.filter(previous_group_id=id).values_list('group_id', flat=True)
  try:
   return (queryset.get(id=qs), True)
  except Group.DoesNotExist:
   raise error

def get_group_with_redirect ( id , queryset = None ) : if ( queryset is None ) : queryset = Group . objects . all ( ) getter = Group . objects . get_from_cache else : getter = queryset . get try : return ( getter ( id = id ) , False ) except Group . DoesNotExist as error : from sentry . models import GroupRedirect qs = GroupRedirect . objects . filter ( previous_group_id = id ) . values_list ( 'group_id' , flat = True ) try : return ( queryset . get ( id = qs ) , True ) except Group . DoesNotExist : raise error
retrieve a group by id .