Skip to content

Commit

Permalink
Merge branch 'main' 1.2.5dev into production
Browse files Browse the repository at this point in the history
  • Loading branch information
LoanR committed Apr 26, 2024
2 parents 0e701a8 + 4512b50 commit 50a77c7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion documentation/maintainers/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ La branche de référence pour les releases est `production`. C'est ici qu'on re
Pour publier une nouvelle version :
- S'assurer d'être sur la branche `production`
- Mettre à jour le numéro de version dans `pyproject.toml` et dans `web/b3desk/__init__.py`
- Mettre un tag sur le commit, portant le numéro de la version, avec `git tag vX.Y.Z`
- Mettre un tag sur le commit, portant le numéro de la version, avec `git tag -a vX.Y.Z -m "Bump to X.Y.Z version`
- Pousser le commit ET le tag `git push origin production --follow-tags`
- Se rendre sur [la page github de publication de version](https://github.com/numerique-gouv/b3desk/releases/new)
- Choisir le tag récemment ajouté, remplir les informations, publier la version.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "b3desk"
version = "1.2.4"
version = "1.2.5"
description = "Outil de visioconférence pour les agents de l'Education Nationale et de l'Etat en général."
authors = ["Your Name <[email protected]>"]
readme = "README.md"
Expand Down
33 changes: 24 additions & 9 deletions web/b3desk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.
import logging
import os
from logging.config import dictConfig

from flask import Flask
from flask import render_template
Expand All @@ -29,7 +29,7 @@
from .utils import enum_converter
from .utils import model_converter

__version__ = "1.2.4"
__version__ = "1.2.5"

LANGUAGES = ["en", "fr"]

Expand Down Expand Up @@ -75,11 +75,26 @@ def setup_cache(app):
cache.init_app(app, config=config)


def setup_logging(app, gunicorn_logging=False):
if gunicorn_logging:
gunicorn_logger = logging.getLogger("gunicorn.error")
app.logger.handlers = gunicorn_logger.handlers
app.logger.setLevel(gunicorn_logger.level)
def setup_logging(app):
if not app.debug and not app.testing:
dictConfig(
{
"version": 1,
"formatters": {
"default": {
"format": "[%(asctime)s] %(levelname)s in %(module)s: %(message)s",
}
},
"handlers": {
"wsgi": {
"class": "logging.handlers.WatchedFileHandler",
"filename": "/var/log/b3desk.log",
"formatter": "default",
}
},
"root": {"level": "INFO", "handlers": ["wsgi"]},
}
)


def setup_i18n(app):
Expand Down Expand Up @@ -238,12 +253,12 @@ def setup_oidc(app):
auth.init_app(app)


def create_app(test_config=None, gunicorn_logging=False):
def create_app(test_config=None):
app = Flask(__name__)
setup_configuration(app, test_config)
setup_celery(app)
setup_cache(app)
setup_logging(app, gunicorn_logging)
setup_logging(app)
setup_i18n(app)
setup_csrf(app)
setup_database(app)
Expand Down

0 comments on commit 50a77c7

Please sign in to comment.