Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Nov 13, 2024
2 parents 1b5b79f + f846842 commit f39a750
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 49 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3
2.4.4
19 changes: 11 additions & 8 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
from app.env import db

from pypnusershub.db.models import Application
from pypnusershub.login_manager import login_manager
from app.utils.errors import handle_unauthenticated_request

from pypnusershub.auth import auth_manager

migrate = Migrate()

Expand Down Expand Up @@ -63,10 +62,18 @@ def create_app():
app.config["URL_REDIRECT"] = "{}/{}".format(app.config["URL_APPLICATION"], "login")
app.secret_key = app.config["SECRET_KEY"]
app.wsgi_app = ProxyFix(app.wsgi_app, x_host=1)
login_manager.init_app(app)
login_manager.login_view = "login.login"
db.init_app(app)
app.config["DB"] = db
providers_config = [
{
"module": "pypnusershub.auth.providers.default.LocalProvider",
"id_provider": "local_provider",
},
]
auth_manager.init_app(
app, prefix="/pypn/auth/", providers_declaration=providers_config
)
auth_manager.home_page = app.config["URL_APPLICATION"]

migrate.init_app(app, db, directory=Path(__file__).absolute().parent / "migrations")

Expand All @@ -92,10 +99,6 @@ def constants_js():
def inject_user():
return dict(user=getattr(g, "user", None))

from pypnusershub import routes

app.register_blueprint(routes.routes, url_prefix="/pypn/auth")

from app.t_roles import route

app.register_blueprint(route.route, url_prefix="/")
Expand Down
12 changes: 7 additions & 5 deletions app/bib_organismes/forms.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
from flask_wtf import FlaskForm
from wtforms import (
StringField,
PasswordField,
BooleanField,
SubmitField,
HiddenField,
SelectField,
validators,
)
from wtforms.validators import DataRequired, Email

# from wtforms_components import IntergerField

def validate_code_postal(form, field):
if len(field.data) != 5:
raise validators.ValidationError(
"Le code postal renseigné comporte plus/moins de 5 caractères"
)


class Organisme(FlaskForm):
Expand All @@ -23,7 +25,7 @@ class Organisme(FlaskForm):
validators=[DataRequired(message="Le nom de l'organisme est obligatoire")],
)
adresse_organisme = StringField("Adresse")
cp_organisme = StringField("Code Postal")
cp_organisme = StringField("Code Postal", validators=[validate_code_postal])
ville_organisme = StringField("Ville")
tel_organisme = StringField("Téléphone")
fax_organisme = StringField("Fax")
Expand Down
7 changes: 7 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
CHANGELOG
=========

2.4.4 (2024-11-12)
------------------

**🚀 Nouveautés**

- Mise à jour de `UsersHub-authentification-module` en 3.0.0 (#225)

2.4.3 (2024-05-27)
------------------

Expand Down
2 changes: 1 addition & 1 deletion requirements-dependencies.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pypnusershub>=2.1.4,<3.0.0
pypnusershub>=3.0.0,<4.0.0
34 changes: 18 additions & 16 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
#
-e file:dependencies/UsersHub-authentification-module#egg=pypnusershub
# via -r requirements-submodules.in
alembic==1.13.1
alembic==1.13.2
# via
# flask-migrate
# pypnusershub
authlib==1.3.0
authlib==1.3.1
# via pypnusershub
bcrypt==4.1.3
bcrypt==4.2.0
# via pypnusershub
blinker==1.8.2
# via flask
certifi==2024.2.2
certifi==2024.7.4
# via requests
cffi==1.16.0
cffi==1.17.0
# via cryptography
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via flask
cryptography==42.0.7
cryptography==43.0.0
# via authlib
dnspython==2.6.1
# via email-validator
email-validator==2.1.1
email-validator==2.2.0
# via wtforms-components
flask==3.0.3
# via
Expand Down Expand Up @@ -64,7 +64,7 @@ idna==3.7
# via
# email-validator
# requests
importlib-metadata==7.1.0
importlib-metadata==8.2.0
# via flask
infinity==1.5
# via intervals
Expand All @@ -85,7 +85,7 @@ markupsafe==2.1.5
# werkzeug
# wtforms
# wtforms-components
marshmallow==3.21.2
marshmallow==3.21.3
# via
# flask-marshmallow
# marshmallow-sqlalchemy
Expand All @@ -94,7 +94,7 @@ marshmallow-sqlalchemy==1.0.0
# via
# -r requirements-common.in
# pypnusershub
packaging==24.0
packaging==24.1
# via
# gunicorn
# marshmallow
Expand All @@ -110,28 +110,28 @@ python-dateutil==2.9.0.post0
# utils-flask-sqlalchemy
python-dotenv==1.0.1
# via -r requirements-common.in
requests==2.32.2
requests==2.32.3
# via pypnusershub
six==1.16.0
# via
# python-dateutil
# wtforms-components
sqlalchemy==1.4.52
sqlalchemy==1.4.53
# via
# alembic
# flask-sqlalchemy
# marshmallow-sqlalchemy
# pypnusershub
# utils-flask-sqlalchemy
typing-extensions==4.11.0
typing-extensions==4.12.2
# via
# alembic
# sqlalchemy
urllib3==2.2.1
urllib3==2.2.2
# via requests
utils-flask-sqlalchemy==0.4.1
# via pypnusershub
validators==0.28.1
validators==0.33.0
# via wtforms-components
werkzeug==3.0.3
# via
Expand All @@ -144,5 +144,7 @@ wtforms==3.1.2
# wtforms-components
wtforms-components==0.10.5
# via -r requirements-common.in
zipp==3.18.2
xmltodict==0.13.0
# via pypnusershub
zipp==3.19.2
# via importlib-metadata
36 changes: 19 additions & 17 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
#
# pip-compile requirements.in
#
alembic==1.13.1
alembic==1.13.2
# via
# flask-migrate
# pypnusershub
authlib==1.3.0
authlib==1.3.1
# via pypnusershub
bcrypt==4.1.3
bcrypt==4.2.0
# via pypnusershub
blinker==1.8.2
# via flask
certifi==2024.2.2
certifi==2024.7.4
# via requests
cffi==1.16.0
cffi==1.17.0
# via cryptography
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via flask
cryptography==42.0.7
cryptography==43.0.0
# via authlib
dnspython==2.6.1
# via email-validator
email-validator==2.1.1
email-validator==2.2.0
# via wtforms-components
flask==3.0.3
# via
Expand Down Expand Up @@ -62,7 +62,7 @@ idna==3.7
# via
# email-validator
# requests
importlib-metadata==7.1.0
importlib-metadata==8.2.0
# via flask
infinity==1.5
# via intervals
Expand All @@ -83,7 +83,7 @@ markupsafe==2.1.5
# werkzeug
# wtforms
# wtforms-components
marshmallow==3.21.2
marshmallow==3.21.3
# via
# flask-marshmallow
# marshmallow-sqlalchemy
Expand All @@ -92,7 +92,7 @@ marshmallow-sqlalchemy==1.0.0
# via
# -r requirements-common.in
# pypnusershub
packaging==24.0
packaging==24.1
# via
# gunicorn
# marshmallow
Expand All @@ -102,36 +102,36 @@ psycopg2==2.9.9
# pypnusershub
pycparser==2.22
# via cffi
pypnusershub==2.1.4
pypnusershub==3.0.0
# via -r requirements-dependencies.in
python-dateutil==2.9.0.post0
# via
# -r requirements-common.in
# utils-flask-sqlalchemy
python-dotenv==1.0.1
# via -r requirements-common.in
requests==2.32.2
requests==2.32.3
# via pypnusershub
six==1.16.0
# via
# python-dateutil
# wtforms-components
sqlalchemy==1.4.52
sqlalchemy==1.4.53
# via
# alembic
# flask-sqlalchemy
# marshmallow-sqlalchemy
# pypnusershub
# utils-flask-sqlalchemy
typing-extensions==4.11.0
typing-extensions==4.12.2
# via
# alembic
# sqlalchemy
urllib3==2.2.1
urllib3==2.2.2
# via requests
utils-flask-sqlalchemy==0.4.1
# via pypnusershub
validators==0.28.1
validators==0.33.0
# via wtforms-components
werkzeug==3.0.3
# via
Expand All @@ -144,5 +144,7 @@ wtforms==3.1.2
# wtforms-components
wtforms-components==0.10.5
# via -r requirements-common.in
zipp==3.18.2
xmltodict==0.13.0
# via pypnusershub
zipp==3.19.2
# via importlib-metadata

0 comments on commit f39a750

Please sign in to comment.