<commit_before>from zou.app.models.project import Project
from zou.app.services import user_service

from .base import BaseModelResource, BaseModelsResource


class ProjectsResource(BaseModelsResource):

    def __init__(self):
        BaseModelsResource.__init__(self, Project)


class ProjectResource(BaseModelResource):

    def __init__(self):
        BaseModelResource.__init__(self, Project)

    def check_read_permissions(self, project):
        user_service.check_project_access(project["id"])<commit_msg>Force all new project to have open status<commit_after>from zou.app.models.project import Project
from zou.app.services import user_service, projects_service

from .base import BaseModelResource, BaseModelsResource


class ProjectsResource(BaseModelsResource):

    def __init__(self):
        BaseModelsResource.__init__(self, Project)


class ProjectResource(BaseModelResource):

    def __init__(self):
        BaseModelResource.__init__(self, Project)

    def check_read_permissions(self, project):
        user_service.check_project_access(project["id"])

    def update_data(self, data):
        open_status = projects_service.get_or_create_open_status()
        data["open_status_id"] = open_status["id"]
{'fraction_non_alphanumeric': 0.08156606851549755, 'fraction_numerical': 0.0, 'mean_word_length': 5.074257425742574, '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': '4919765', 'n_tokens_mistral': 341, 'n_tokens_neox': 327, 'n_words': 72}