def process_request(self, request):
    if not ConfigData.get_configdata('site_installed', default=False):
      theming.check_themes()
      if not request.path.startswith('/install') and not request.path.startswith('/loader'):
        return http.HttpResponseRedirect(reverse('install'))
      
    if not request.path.startswith('/install') and not request.path.startswith('/loader'):
      for app in settings.INSTALLED_APPS:
        if not ConfigData.is_installed(app):
          try:
            Action.register_action(app)
          except exceptions.ImproperlyConfigured:
            pass #logging.error("   can not register %s actions" % app)

        if not ConfigData.is_installed(app):
          try:
            _install = util.get_attr_from("%s.config.install" % app)
            _install()
          except exceptions.ImproperlyConfigured:
            pass #logging.error("ImproperlyConfigured -> %s.config.install" % app)

          areas = util.get_config_value(app, "areas", {})
          areas_vals = sorted(areas.values(), key=lambda x: x.get("order", 1000))
          
          ConfigData.set_configdata(app, True, label='installed_app',
                                    extra={'adminareas':areas_vals})
Beispiel #2
0
def get_template_sources(template_name, template_dirs=None):
  from common.models import Theme
  
  active_theme = Theme.get_active()

  if not active_theme:
    check_themes()

  for themes_dir in get_theme_root_dirs(template_dirs):
    active_theme_dir = safe_join(themes_dir, active_theme.directory_name)
    try:
      yield safe_join(active_theme_dir, template_name)
    except UnicodeDecodeError:
      raise
    except ValueError:
      pass