Skip to content

Commit 85c7ae2

Browse files
authored
Merge pull request #7 from roicort/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents b559fac + 483f350 commit 85c7ae2

25 files changed

Lines changed: 2184 additions & 1132 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
- id: end-of-file-fixer
1111
- id: trailing-whitespace
1212
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.9.9
13+
rev: v0.11.0
1414
hooks:
1515
- id: ruff
1616
args:

django-liberty/backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ COPY src .
2222
RUN poetry run python manage.py collectstatic --noinput
2323

2424
ENTRYPOINT ["sh","entrypoint.sh"]
25-
CMD ["poetry", "run", "gunicorn","--bind", ":8000", "main.wsgi:application"]
25+
CMD ["poetry", "run", "gunicorn","--bind", ":8000", "main.wsgi:application"]

django-liberty/backend/src/account/templates/registration/login.html

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,48 @@
1-
{% extends 'unfold/layouts/skeleton.html' %}
2-
{% load i18n static %}
3-
4-
{% block extrastyle %}
5-
{{ block.super }}
6-
{{ form.media }}
7-
{% endblock %}
8-
9-
{% block bodyclass %}
10-
{{ block.super }}bg-gray-50 login dark:bg-gray-900
11-
{% endblock %}
12-
13-
{% block usertools %}{% endblock %}
14-
{% block nav-global %}{% endblock %}
15-
{% block nav-sidebar %}{% endblock %}
16-
{% block content_title %}{% endblock %}
17-
{% block breadcrumbs %}{% endblock %}
18-
19-
{% block title %}
20-
{{ title }} | {{ site_title }}
21-
{% endblock %}
22-
23-
{% block base %}
1+
{% extends 'unfold/layouts/skeleton.html' %} {% load i18n static %} {% block
2+
extrastyle %} {{ block.super }} {{ form.media }} {% endblock %} {% block
3+
bodyclass %} {{ block.super }}bg-gray-50 login dark:bg-gray-900 {% endblock %}
4+
{% block usertools %}{% endblock %} {% block nav-global %}{% endblock %} {%
5+
block nav-sidebar %}{% endblock %} {% block content_title %}{% endblock %} {%
6+
block breadcrumbs %}{% endblock %} {% block title %} {{ title }} | {{ site_title
7+
}} {% endblock %} {% block base %}
248
<div class="flex min-h-screen">
259
<div class="flex flex-grow items-center justify-center mx-auto px-4 relative">
2610
<div class="w-full sm:w-96">
2711
<h1 class="font-semibold mb-10">
28-
<span class="block text-font-important-light dark:text-font-important-dark">
12+
<span
13+
class="block text-font-important-light dark:text-font-important-dark"
14+
>
2915
{% trans 'Welcome back to' %}
3016
</span>
3117
<span class="block text-primary-600 text-xl dark:text-primary-500">
3218
{{ site_title }}
3319
</span>
3420
</h1>
3521

36-
{% include "unfold/helpers/messages/errornote.html" with errors=form.errors %}
37-
{% include "unfold/helpers/messages/error.html" with errors=form.non_field_errors %}
38-
39-
{% if user.is_authenticated %}
40-
{% blocktranslate trimmed asvar message %}
41-
You are authenticated as {{ username }}, but are not authorized to access this page. Would you like to login to a different account?
42-
{% endblocktranslate %}
43-
{% include "unfold/helpers/messages/error.html" with error=message %}
44-
{% endif %}
45-
46-
{% block login_before %}{% endblock %}
22+
{% include "unfold/helpers/messages/errornote.html" with
23+
errors=form.errors %} {% include "unfold/helpers/messages/error.html" with
24+
errors=form.non_field_errors %} {% if user.is_authenticated %} {%
25+
blocktranslate trimmed asvar message %} You are authenticated as {{
26+
username }}, but are not authorized to access this page. Would you like to
27+
login to a different account? {% endblocktranslate %} {% include
28+
"unfold/helpers/messages/error.html" with error=message %} {% endif %} {%
29+
block login_before %}{% endblock %}
4730

4831
<form method="post" action="{% url 'account:login' %}">
49-
{% csrf_token %}
50-
{% include "unfold/helpers/field.html" with field=form.username %}
51-
{% include "unfold/helpers/field.html" with field=form.password %}
32+
{% csrf_token %} {% include "unfold/helpers/field.html" with
33+
field=form.username %} {% include "unfold/helpers/field.html" with
34+
field=form.password %}
5235

5336
<div class="submit-row">
54-
<button type="submit" class="bg-primary-600 border border-transparent flex flex-row font-semibold group items-center justify-center py-2 rounded-md text-sm text-white w-full">
37+
<button
38+
type="submit"
39+
class="bg-primary-600 border border-transparent flex flex-row font-semibold group items-center justify-center py-2 rounded-md text-sm text-white w-full"
40+
>
5541
{% translate 'Log in' %}
56-
<i class="material-symbols-outlined ml-2 relative right-0 text-lg transition-all group-hover:-right-1">arrow_forward</i>
42+
<i
43+
class="material-symbols-outlined ml-2 relative right-0 text-lg transition-all group-hover:-right-1"
44+
>arrow_forward</i
45+
>
5746
</button>
5847
</div>
5948

django-liberty/backend/src/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if [ "${DISABLE_DB_MIGRATIONS}" != "true" ] && [ ! -f /app/db_status ]; then
77

88
poetry run python manage.py makemigrations
99
poetry run python manage.py migrate
10-
10+
1111
# Mark initialization as done
1212
echo "Successfuly migrated DB!"
1313
touch /app/db_status
@@ -28,4 +28,4 @@ fi
2828

2929

3030
# Continue with the original Docker command
31-
exec "$@"
31+
exec "$@"

django-liberty/backend/src/main/management/commands/import_oidc_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def handle(self, *args, **options):
2424
client_id=os.environ.get("OIDC_CLIENT_ID"),
2525
client_secret=os.environ.get("OIDC_CLIENT_SECRET"),
2626
redirect_uris=[os.environ.get("REDIRECT_URI")],
27-
reuse_consent=False
27+
reuse_consent=False,
2828
)
2929
c.scope = ["openid", "profile", "email"]
3030
c.save()

django-liberty/backend/src/main/settings/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
ALLOWED_HOSTS = [
2222
SITE_URL.replace("http://", "").replace("https://", ""),
2323
FRONTEND_URL.replace("http://", "").replace("https://", ""),
24-
] + environ.get("ALLOWED_HOSTS", "").replace("http://", "").replace("https://", "").split(",")
24+
] + environ.get("ALLOWED_HOSTS", "").replace("http://", "").replace(
25+
"https://", ""
26+
).split(",")
2527

2628
WSGI_APPLICATION = "main.wsgi.application"
2729

django-liberty/frontend-next/src/app/page.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ function SessionInfo({ data }) {
3838
}
3939

4040
function HandleSign({ data }) {
41-
return data ? (
42-
<SignOut />
43-
) : (
44-
<SignIn />
45-
);
41+
return data ? <SignOut /> : <SignIn />;
4642
}
4743

4844
export default async function Home() {
@@ -51,7 +47,6 @@ export default async function Home() {
5147
return (
5248
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
5349
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
54-
5550
<Image
5651
className="dark:invert"
5752
src="/next.svg"
@@ -79,10 +74,7 @@ export default async function Home() {
7974
<SessionInfo data={session} />
8075

8176
<div className="flex gap-4 items-center flex-col sm:flex-row">
82-
83-
<div
84-
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 sm:w-auto"
85-
>
77+
<div className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 sm:w-auto">
8678
<HandleSign data={session} />
8779
<Image
8880
className="dark:invert"
@@ -101,9 +93,7 @@ export default async function Home() {
10193
>
10294
Sign Up
10395
</a>
104-
10596
</div>
106-
10797
</main>
10898

10999
<footer className="row-start-3 flex gap-[24px] flex-wrap items-center justify-center">
@@ -153,7 +143,6 @@ export default async function Home() {
153143
Go to nextjs.org →
154144
</a>
155145
</footer>
156-
157146
</div>
158147
);
159148
}

0 commit comments

Comments
 (0)