@handle_response_format
@treeio_login_required
def stream_checkmail(request, stream_id, response_format='html'):
 user = request.user.profile
 stream = get_object_or_404(MessageStream, pk=stream_id)
 if (not user.has_permission(stream)):
  return user_denied(request, message="You don't have access to this Stream", response_format=response_format)
 try:
  stream.process_email()
  messages.add_message(request, messages.INFO, _('E-mails fetched successfully.'), fail_silently=True)
 except:
  try:
   messages.add_message(request, messages.ERROR, _('Failed to retrieve messages for this stream. Please check stream settings'), fail_silently=True)
  except:
   pass
 return HttpResponseRedirect(reverse('messaging_stream_view', args=[stream.id]))

@ handle_response_format @ treeio_login_required def stream_checkmail ( request , stream_id , response_format = 'html' ) : user = request . user . profile stream = get_object_or_404 ( MessageStream , pk = stream_id ) if ( not user . has_permission ( stream ) ) : return user_denied ( request , message = "You don't have access to this Stream" , response_format = response_format ) try : stream . process_email ( ) messages . add_message ( request , messages . INFO , _ ( 'E-mails fetched successfully.' ) , fail_silently = True ) except : try : messages . add_message ( request , messages . ERROR , _ ( 'Failed to retrieve messages for this stream. Please check stream settings' ) , fail_silently = True ) except : pass return HttpResponseRedirect ( reverse ( 'messaging_stream_view' , args = [ stream . id ] ) )
stream check mail .