Merge branch 'bugfix/cant-switch-accounts-after-old-login' into 'main'

Fix bug: can’t switch accounts after using old login mode

See merge request brutaldon/brutaldon!13
This commit is contained in:
Dorian Vertumna 2024-10-25 19:27:54 +00:00
commit e690896ed3
4 changed files with 6 additions and 5 deletions

View File

@ -165,7 +165,7 @@
<div class="container">
{% block content %}
<h1 class="title">
Title
Brutaldon
</h1>
<p class="subtitle">
Brutaldon is totally a thing.

View File

@ -14,14 +14,15 @@
{% endblock %}
{% block content %}
<h1>Brutaldon ({{ own_acct.username }}) - {{ timeline_name }} timelime</h1>
{% if form %}
<h1 class="title">Post</h1>
<h2 class="title">Post</h2>
<div class="box">
{% include "main/post_minimal_partial.html" %}
</div>
<hr class="is-hidden">
{% endif %}
<h1 class="title">Your {{ timeline_name }} timeline</h1>
<h2 class="title">Your {{ timeline_name }} timeline</h2>
<div id="timeline">
{% for toot in toots %}
{% cache 600 toot_partial toot.id %}

View File

@ -29,7 +29,7 @@
<div class="media-content">
<div class="content">
<p>
<strong>{{ toot.account.display_name | fix_emojos:toot.account.emojis | strip_html |safe}}</strong>
<h3><strong>{{ toot.account.display_name | fix_emojos:toot.account.emojis | strip_html |safe}}</strong></h3>
<small><a href="{% url "user" toot.account.acct %}">
@{{ toot.account.acct }}</a></small>
<a href="{{ toot.url }}">

View File

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