pre-commit update

This commit is contained in:
Éloi Rivard 2023-03-14 12:08:37 +01:00
parent 4742ea3ce7
commit 94af1744ba
15 changed files with 63 additions and 67 deletions

View file

@ -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"]

View file

@ -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(),

View file

@ -22,9 +22,9 @@
</div>
<div class="ui attached clearing segment">
<form method="POST"
id="{{ reset }}"
action="{{ url_for('account.firstlogin', uid=uid) }}"
role="form"
id="{{ reset }}"
action="{{ url_for('account.firstlogin', uid=uid) }}"
role="form"
>
{{ form.hidden_tag() if form.hidden_tag }}

View file

@ -25,10 +25,10 @@
</div>
<div class="ui attached clearing segment">
<form method="POST"
id="{{ form.id or form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
class="ui form"
id="{{ form.id or form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
class="ui form"
>
{{ form.hidden_tag() if form.hidden_tag }}

View file

@ -54,10 +54,10 @@
</h2>
<form method="POST"
id="{{ form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
class="ui form"
id="{{ form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
class="ui form"
>
{{ form.hidden_tag() if form.hidden_tag }}
{{ sui.render_field(form.display_name) }}

View file

@ -96,10 +96,10 @@
<div class="ui attached segment">
<form method="POST"
id="{{ form.id or form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
class="ui form"
id="{{ form.id or form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
class="ui form"
>
{{ form.hidden_tag() if form.hidden_tag }}
{% block uid_field scoped %}

View file

@ -24,10 +24,10 @@
{{ flask.messages() }}
<form method="POST"
id="{{ form.id or form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
class="ui form"
id="{{ form.id or form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
class="ui form"
>
{{ form.hidden_tag() if form.hidden_tag }}

View file

@ -12,9 +12,9 @@ display=true
{% set field_visible = field.type != 'HiddenField' and field.type !='CSRFTokenField' %}
{% if container and field_visible %}
<div class="field {{ kwargs.pop('class_', '') }}
{%- if field.errors %} error{% endif -%}
{%- if field.render_kw and "disabled" in field.render_kw %} disabled{% endif -%}"
{% if not display %}style="display: none"{% endif %}
{%- if field.errors %} error{% endif -%}
{%- if field.render_kw and "disabled" in field.render_kw %} disabled{% endif -%}"
{% if not display %}style="display: none"{% endif %}
>
{% endif %}
@ -32,12 +32,12 @@ display=true
{% set labeled = suffix_text or corner_indicator %}
{% if field_visible %}
<div class="ui
{% 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 %}
">
{% 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 %}<i class="{{ icon }} icon"></i>{% endif %}
@ -124,11 +124,11 @@ btn_class='ui right floated primary button',
action=none,
id=none) -%}
<form method="POST"
id="{{ id or form.__class__.__name__|lower }}"
action="{{ action or form.action }}"
role="form"
enctype="multipart/form-data"
class="ui form {{ class_ }}"
id="{{ id or form.__class__.__name__|lower }}"
action="{{ action or form.action }}"
role="form"
enctype="multipart/form-data"
class="ui form {{ class_ }}"
>
{% if caller %}
{{ caller() }}

View file

@ -63,11 +63,11 @@
</div>
<form method="POST"
id="{{ form.__class__.__name__|lower }}"
action="{{ form.action }}"
role="form"
enctype="multipart/form-data"
class="ui form"
id="{{ form.__class__.__name__|lower }}"
action="{{ form.action }}"
role="form"
enctype="multipart/form-data"
class="ui form"
>
{{ sui.render_fields(form) }}

View file

@ -22,10 +22,10 @@
<div class="ui center aligned container">
<form method="POST"
id="{{ form.id or form.__class__.__name__|lower }}"
action="{{ form.action }}"
role="form"
class="ui form"
id="{{ form.id or form.__class__.__name__|lower }}"
action="{{ form.action }}"
role="form"
class="ui form"
>
{{ form.hidden_tag() if form.hidden_tag }}
<div class="ui stackable buttons">

View file

@ -24,10 +24,10 @@
{{ flask.messages() }}
<form method="POST"
id="{{ form.id or form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
class="ui form"
id="{{ form.id or form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
class="ui form"
>
{{ form.hidden_tag() if form.hidden_tag }}

View file

@ -78,11 +78,11 @@
</h2>
<form method="POST"
id="{{ form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
enctype="multipart/form-data"
class="ui form info{% if user.can_manage_users and edited_user and not edited_user.has_password() %} warning{% endif %} profile-form"
id="{{ form.__class__.__name__|lower }}"
action="{{ request.url }}"
role="form"
enctype="multipart/form-data"
class="ui form info{% if user.can_manage_users and edited_user and not edited_user.has_password() %} warning{% endif %} profile-form"
>
{#{ render_field(form.csrf_token) }#}

View file

@ -35,28 +35,28 @@
{% endif %}
{% if user.can_edit_self %}
<a class="item {% if menuitem == "profile" %}active{% endif %}"
href="{{ url_for('account.profile_edition', username=user.uid[0]) }}">
href="{{ url_for('account.profile_edition', username=user.uid[0]) }}">
<i class="id card icon"></i>
{% trans %}My profile{% endtrans %}
</a>
{% endif %}
{% if user.can_use_oidc %}
<a class="item {% if menuitem == "consents" %}active{% endif %}"
href="{{ url_for('oidc.consents.consents') }}">
href="{{ url_for('oidc.consents.consents') }}">
<i class="handshake icon"></i>
{% trans %}My consents{% endtrans %}
</a>
{% endif %}
{% if user.can_manage_users %}
<a class="item {% if menuitem == "users" %}active{% endif %}"
href="{{ url_for('account.users') }}">
href="{{ url_for('account.users') }}">
<i class="address book icon"></i>
{% trans %}Users{% endtrans %}
</a>
{% endif %}
{% if user.can_manage_groups %}
<a class="item {% if menuitem == "groups" %}active{% endif %}"
href="{{ url_for('groups.groups') }}">
href="{{ url_for('groups.groups') }}">
<i class="users icon"></i>
{% trans %}Groups{% endtrans %}
</a>

View file

@ -34,25 +34,25 @@
</div>
{% endif %}
<a class="item {% if menuitem == "profile" %}active{% endif %}"
href="{{ url_for('account.profile_edition', username=user.uid[0]) }}">
href="{{ url_for('account.profile_edition', username=user.uid[0]) }}">
<i class="id card icon"></i>
{% trans %}My profile{% endtrans %}
</a>
<a class="item {% if menuitem == "consents" %}active{% endif %}"
href="{{ url_for('consents.consents') }}">
href="{{ url_for('consents.consents') }}">
<i class="handshake icon"></i>
{% trans %}My consents{% endtrans %}
</a>
{% if user.can_manage_users %}
<a class="item {% if menuitem == "users" %}active{% endif %}"
href="{{ url_for('account.users') }}">
href="{{ url_for('account.users') }}">
<i class="users icon"></i>
{% trans %}Users{% endtrans %}
</a>
{% endif %}
{% if user.can_manage_groups %}
<a class="item {% if menuitem == "groups" %}active{% endif %}"
href="{{ url_for('groups.groups') }}">
href="{{ url_for('groups.groups') }}">
<i class="users cog icon"></i>
{% trans %}Groups{% endtrans %}
</a>

View file

@ -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)