Beispiel #1
0
 def dispatch(self, request, report_config_id, **kwargs):
     self.request = request
     self.domain = request.domain
     self.report_config_id = report_config_id
     self.lang = self.request.couch_user.language or default_language()
     user = request.couch_user
     if self.has_permissions(self.domain, user):
         self.get_spec_or_404()
         if kwargs.get('render_as') == 'email':
             return self.email_response
         elif kwargs.get('render_as') == 'excel':
             return self.excel_response
         elif request.is_ajax() or request.GET.get('format', None) == 'json':
             return self.get_ajax(request, **kwargs)
         self.content_type = None
         self.add_warnings(request)
         return super(ConfigurableReport, self).dispatch(request, self.domain, **kwargs)
     else:
         raise Http403()
Beispiel #2
0
 def lang(self):
     if self._lang is not None:
         return self._lang
     return self.request.couch_user.language or default_language()
Beispiel #3
0
 def lang(self):
     if self._lang is not None:
         return self._lang
     return self.request.couch_user.language or default_language()