From e03144c2e9fa69334b0886772d219655bec50109 Mon Sep 17 00:00:00 2001 From: Dorian Wood Date: Tue, 1 Aug 2023 11:16:44 -0400 Subject: [PATCH 1/2] Modified header tags There is now a single h1 tag. User posting forms and the timeline are in their own h2, and individual posts are in an h3 made around the toot title. --- brutaldon/templates/base.html | 2 +- brutaldon/templates/main/timeline.html | 5 +++-- brutaldon/templates/main/toot_partial.html | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/brutaldon/templates/base.html b/brutaldon/templates/base.html index 5574b15..81b2161 100644 --- a/brutaldon/templates/base.html +++ b/brutaldon/templates/base.html @@ -165,7 +165,7 @@
{% block content %}

- Title + Brutaldon

Brutaldon is totally a thing. diff --git a/brutaldon/templates/main/timeline.html b/brutaldon/templates/main/timeline.html index d229d2f..00598ab 100644 --- a/brutaldon/templates/main/timeline.html +++ b/brutaldon/templates/main/timeline.html @@ -14,14 +14,15 @@ {% endblock %} {% block content %} +

Brutaldon ({{ own_acct.username }}) - {{ timeline_name }} timelime

{% if form %} -

Post

+

Post

{% include "main/post_minimal_partial.html" %}
{% endif %} -

Your {{ timeline_name }} timeline

+

Your {{ timeline_name }} timeline

{% for toot in toots %} {% cache 600 toot_partial toot.id %} diff --git a/brutaldon/templates/main/toot_partial.html b/brutaldon/templates/main/toot_partial.html index 00d88f5..62c0443 100644 --- a/brutaldon/templates/main/toot_partial.html +++ b/brutaldon/templates/main/toot_partial.html @@ -29,7 +29,7 @@

- {{ toot.account.display_name | fix_emojos:toot.account.emojis | strip_html |safe}} +

{{ toot.account.display_name | fix_emojos:toot.account.emojis | strip_html |safe}}

@{{ toot.account.acct }} From f9839ea5cb9aac1a3b6d087a81b6d974793e260e Mon Sep 17 00:00:00 2001 From: Dzmitry Kushnarou Date: Wed, 15 May 2024 22:48:21 +0100 Subject: [PATCH 2/2] Fix bug: can't switch accounts after using old login mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem reason: account.id might not be available before account.save(), if the account is newly-created Changes: switches .save() call and accounts_dict update, to ensure that the .id is available in accounts_dict Note: this bugfix only fixes logins after this change. If you’ve logged in using the old code, your session data still won't have ID. You need to log out of all the accounts and then log in again. --- brutaldon/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brutaldon/views.py b/brutaldon/views.py index 971c520..6680e00 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -583,6 +583,7 @@ def old_login(request): account.username = request.session["active_username"] request.session["timezone"] = account.preferences.timezone + account.save() accounts_dict = request.session.get("accounts_dict") if not accounts_dict: accounts_dict = {} @@ -591,7 +592,6 @@ def old_login(request): "user": user, } request.session["accounts_dict"] = accounts_dict - account.save() return redirect(home) except IntegrityError: