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"> <div class="container">
{% block content %} {% block content %}
<h1 class="title"> <h1 class="title">
Title Brutaldon
</h1> </h1>
<p class="subtitle"> <p class="subtitle">
Brutaldon is totally a thing. Brutaldon is totally a thing.

View File

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

View File

@ -29,7 +29,7 @@
<div class="media-content"> <div class="media-content">
<div class="content"> <div class="content">
<p> <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 %}"> <small><a href="{% url "user" toot.account.acct %}">
@{{ toot.account.acct }}</a></small> @{{ toot.account.acct }}</a></small>
<a href="{{ toot.url }}"> <a href="{{ toot.url }}">

View File

@ -583,6 +583,7 @@ def old_login(request):
account.username = request.session["active_username"] account.username = request.session["active_username"]
request.session["timezone"] = account.preferences.timezone request.session["timezone"] = account.preferences.timezone
account.save()
accounts_dict = request.session.get("accounts_dict") accounts_dict = request.session.get("accounts_dict")
if not accounts_dict: if not accounts_dict:
accounts_dict = {} accounts_dict = {}
@ -591,7 +592,6 @@ def old_login(request):
"user": user, "user": user,
} }
request.session["accounts_dict"] = accounts_dict request.session["accounts_dict"] = accounts_dict
account.save()
return redirect(home) return redirect(home)
except IntegrityError: except IntegrityError: