<commit_before>import logging
import openerp
from openerp.http import request

import werkzeug

from openerp.addons.web import http


logger = logging.getLogger(__name__)


class WebsiteMaintenance(openerp.addons.website.controllers.main.Website):
    
    def is_maintenance_mode(self):
        is_on = ['on', '1', 'true', 'yes']
        maintenance_mode = request.registry['ir.config_parameter'].get_param(
            request.cr, request.uid, 'website.maintenance_mode')
        logger.debug("maintenance_mode value: %s" % (maintenance_mode))
        if maintenance_mode in is_on:
            logger.warn("Maintenance mode on")
            
            if not request.uid:
                logger.info("Not uid, request auth public")
                self._auth_method_public()

            allowed_group = request.env['ir.model.data'].sudo().get_object('base', 'group_website_designer')
            if allowed_group in request.env.user.groups_id:<commit_msg>[FIX] Fixes for import problem with some odoo version<commit_after>import logging
import openerp
from openerp.http import request

import werkzeug

from openerp.addons.web import http
from openerp.addons.website.controllers.main import Website

logger = logging.getLogger(__name__)


class WebsiteMaintenance(Website):

    def is_maintenance_mode(self):
        is_on = ['on', '1', 'true', 'yes']
        maintenance_mode = request.registry['ir.config_parameter'].get_param(
            request.cr, request.uid, 'website.maintenance_mode')
        logger.debug("maintenance_mode value: %s" % (maintenance_mode))
        if maintenance_mode in is_on:
            logger.warn("Maintenance mode on")
            
            if not request.uid:
                logger.info("Not uid, request auth public")
                self._auth_method_public()

            allowed_group = request.env['ir.model.data'].sudo().get_object('base', 'group_website_designer')
            if allowed_group in request.env.user.groups_id:
{'fraction_non_alphanumeric': 0.10379746835443038, 'fraction_numerical': 0.0010126582278481013, 'mean_word_length': 3.024439918533605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5992281', 'n_tokens_mistral': 581, 'n_tokens_neox': 556, 'n_words': 125}