From 94af1744baf74e511cc4b8a6e4dcb9144e470010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Tue, 14 Mar 2023 12:08:37 +0100 Subject: [PATCH] pre-commit update --- .pre-commit-config.yaml | 9 +++--- canaille/oidc/oauth.py | 1 - canaille/templates/firstlogin.html | 6 ++-- canaille/templates/forgotten-password.html | 8 +++--- canaille/templates/group.html | 8 +++--- canaille/templates/invite.html | 8 +++--- canaille/templates/login.html | 8 +++--- canaille/templates/macro/fomanticui.html | 28 +++++++++---------- .../templates/oidc/admin/client_edit.html | 10 +++---- canaille/templates/oidc/user/logout.html | 8 +++--- canaille/templates/password.html | 8 +++--- canaille/templates/profile.html | 10 +++---- canaille/themes/default/base.html | 8 +++--- tests/fixtures/themes/test/base.html | 8 +++--- tests/test_profile.py | 2 -- 15 files changed, 63 insertions(+), 67 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 296df4a6..ea0b84bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,11 +7,11 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - repo: https://github.com/PyCQA/autoflake - rev: v2.0.0 + rev: v2.0.2 hooks: - id: autoflake - repo: https://github.com/hadialqattan/pycln - rev: v2.1.2 + rev: v2.1.3 hooks: - id: pycln args: [--config=pyproject.toml] @@ -26,11 +26,10 @@ repos: - id: pyupgrade args: ["--py37-plus"] - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black - repo: https://github.com/rtts/djhtml - rev: v1.5.2 + rev: 3.0.5 hooks: - id: djhtml - args: ["--in-place"] diff --git a/canaille/oidc/oauth.py b/canaille/oidc/oauth.py index 67f99312..cfcce124 100644 --- a/canaille/oidc/oauth.py +++ b/canaille/oidc/oauth.py @@ -59,7 +59,6 @@ def get_issuer(): def get_jwt_config(grant): - with open(current_app.config["JWT"]["PRIVATE_KEY"]) as pk: return { "key": pk.read(), diff --git a/canaille/templates/firstlogin.html b/canaille/templates/firstlogin.html index b4a16d1e..b5ce7d38 100644 --- a/canaille/templates/firstlogin.html +++ b/canaille/templates/firstlogin.html @@ -22,9 +22,9 @@
{{ form.hidden_tag() if form.hidden_tag }} diff --git a/canaille/templates/forgotten-password.html b/canaille/templates/forgotten-password.html index 635ddaa3..ea70ce23 100644 --- a/canaille/templates/forgotten-password.html +++ b/canaille/templates/forgotten-password.html @@ -25,10 +25,10 @@
{{ form.hidden_tag() if form.hidden_tag }} diff --git a/canaille/templates/group.html b/canaille/templates/group.html index b798390c..bf3d971b 100644 --- a/canaille/templates/group.html +++ b/canaille/templates/group.html @@ -54,10 +54,10 @@ {{ form.hidden_tag() if form.hidden_tag }} {{ sui.render_field(form.display_name) }} diff --git a/canaille/templates/invite.html b/canaille/templates/invite.html index 0023e094..b1ded4d9 100644 --- a/canaille/templates/invite.html +++ b/canaille/templates/invite.html @@ -96,10 +96,10 @@
{{ form.hidden_tag() if form.hidden_tag }} {% block uid_field scoped %} diff --git a/canaille/templates/login.html b/canaille/templates/login.html index 8cba6e07..39fd1411 100644 --- a/canaille/templates/login.html +++ b/canaille/templates/login.html @@ -24,10 +24,10 @@ {{ flask.messages() }} {{ form.hidden_tag() if form.hidden_tag }} diff --git a/canaille/templates/macro/fomanticui.html b/canaille/templates/macro/fomanticui.html index 9682f37f..99a50f60 100644 --- a/canaille/templates/macro/fomanticui.html +++ b/canaille/templates/macro/fomanticui.html @@ -12,9 +12,9 @@ display=true {% set field_visible = field.type != 'HiddenField' and field.type !='CSRFTokenField' %} {% if container and field_visible %}
{% endif %} @@ -32,12 +32,12 @@ display=true {% set labeled = suffix_text or corner_indicator %} {% if field_visible %}
+ {% if suffix_text %}right{% endif %} + {% if corner_indicator %}corner{% endif %} + {% if labeled %}labeled{% endif %} + {% if icon %}left icon {% endif %} + {% if field.type not in ("BooleanField", "RadioField") %}input{% endif %} + "> {% endif %} {% if icon %}{% endif %} @@ -124,11 +124,11 @@ btn_class='ui right floated primary button', action=none, id=none) -%} {% if caller %} {{ caller() }} diff --git a/canaille/templates/oidc/admin/client_edit.html b/canaille/templates/oidc/admin/client_edit.html index 7e75acac..547587ff 100644 --- a/canaille/templates/oidc/admin/client_edit.html +++ b/canaille/templates/oidc/admin/client_edit.html @@ -63,11 +63,11 @@
{{ sui.render_fields(form) }} diff --git a/canaille/templates/oidc/user/logout.html b/canaille/templates/oidc/user/logout.html index 524874ab..ba4069ee 100644 --- a/canaille/templates/oidc/user/logout.html +++ b/canaille/templates/oidc/user/logout.html @@ -22,10 +22,10 @@
{{ form.hidden_tag() if form.hidden_tag }}
diff --git a/canaille/templates/password.html b/canaille/templates/password.html index f4b39efb..fa1ac630 100644 --- a/canaille/templates/password.html +++ b/canaille/templates/password.html @@ -24,10 +24,10 @@ {{ flask.messages() }} {{ form.hidden_tag() if form.hidden_tag }} diff --git a/canaille/templates/profile.html b/canaille/templates/profile.html index d4b7ccd2..9212fc3d 100644 --- a/canaille/templates/profile.html +++ b/canaille/templates/profile.html @@ -78,11 +78,11 @@ {#{ render_field(form.csrf_token) }#} diff --git a/canaille/themes/default/base.html b/canaille/themes/default/base.html index 169d37e0..a2d6b589 100644 --- a/canaille/themes/default/base.html +++ b/canaille/themes/default/base.html @@ -35,28 +35,28 @@ {% endif %} {% if user.can_edit_self %} + href="{{ url_for('account.profile_edition', username=user.uid[0]) }}"> {% trans %}My profile{% endtrans %} {% endif %} {% if user.can_use_oidc %} + href="{{ url_for('oidc.consents.consents') }}"> {% trans %}My consents{% endtrans %} {% endif %} {% if user.can_manage_users %} + href="{{ url_for('account.users') }}"> {% trans %}Users{% endtrans %} {% endif %} {% if user.can_manage_groups %} + href="{{ url_for('groups.groups') }}"> {% trans %}Groups{% endtrans %} diff --git a/tests/fixtures/themes/test/base.html b/tests/fixtures/themes/test/base.html index 05c25ace..6e748a6d 100644 --- a/tests/fixtures/themes/test/base.html +++ b/tests/fixtures/themes/test/base.html @@ -34,25 +34,25 @@
{% endif %} + href="{{ url_for('account.profile_edition', username=user.uid[0]) }}"> {% trans %}My profile{% endtrans %} + href="{{ url_for('consents.consents') }}"> {% trans %}My consents{% endtrans %} {% if user.can_manage_users %} + href="{{ url_for('account.users') }}"> {% trans %}Users{% endtrans %} {% endif %} {% if user.can_manage_groups %} + href="{{ url_for('groups.groups') }}"> {% trans %}Groups{% endtrans %} diff --git a/tests/test_profile.py b/tests/test_profile.py index 047dba9e..ce7cce1a 100644 --- a/tests/test_profile.py +++ b/tests/test_profile.py @@ -94,7 +94,6 @@ def test_edition_permission( bar_group, jpeg_photo, ): - testclient.app.config["ACL"]["DEFAULT"]["PERMISSIONS"] = [] testclient.get("/profile/user", status=403) @@ -592,7 +591,6 @@ def test_photo_on_profile_edition( logged_user, jpeg_photo, ): - # Add a photo res = testclient.get("/profile/user", status=200) res.form["jpegPhoto"] = Upload("logo.jpg", jpeg_photo)