1
0
mirror of https://gitlab.com/brutaldon/brutaldon synced 2025-01-05 04:26:39 +01:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Peter Fidelman
8bbe395de2 Merge branch 'timelime_timeline' into 'main'
Corrected typo: timelime -> timeline

See merge request brutaldon/brutaldon!10
2024-10-25 19:28:17 +00:00
Dorian Vertumna
e690896ed3 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
2024-10-25 19:27:54 +00:00
Jason McBrayer
31825784ab Support and prefer Django 4.2.x.
Backwards compatibility for 3.2 LTS is provided for now, but you'll
have to change the pipfile if you insist on it.

Signed-off-by: Dorian Wood <dorian@threeraccoons.com>
2024-10-25 15:09:44 -04:00
DJ Sundog
f4f1c19ffb Merge branch 'fix/support-gts' into 'main'
pin bleach dep to 4.1, disable mastodon version checks

See merge request brutaldon/brutaldon!11
2024-10-25 15:05:18 -04:00
Dzmitry Kushnarou
f9839ea5cb Fix bug: can't switch accounts after using old login mode
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.
2024-05-15 22:48:21 +01:00
Peter Fidelman
8813dd68f5 Corrected typo: timelime -> timeline 2022-11-30 20:44:18 -08:00
6 changed files with 14 additions and 5 deletions

View File

@ -21,9 +21,10 @@ requests = "*"
six = "*"
"urllib3" = "*"
webencodings = "*"
Django = "~=3.2"
Django = "~=4.2"
django-html_sanitizer = "*"
inscriptis = "*"
lxml = "*"
[dev-packages]
python-lsp-server = {extras = ["pyflakes", "rope", "yapf"], version = "*"}

View File

@ -12,6 +12,14 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
import os
# Work around issue in sanitizer
import django
try:
from django.utils.encoding import smart_text
except:
from django.utils.encoding import smart_str
django.utils.encoding.smart_text = smart_str
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

View File

@ -4,7 +4,7 @@
{% load sanitizer %}
{% block title %}
Brutaldon ({{ own_acct.username }}) - Notifications timelime
Brutaldon ({{ own_acct.username }}) - Notifications timeline
{% endblock %}
{% comment %}

View File

@ -4,7 +4,7 @@
{% load cache %}
{% block title %}
Brutaldon ({{ own_acct.username }}) - {{ timeline_name }} timelime
Brutaldon ({{ own_acct.username }}) - {{ timeline_name }} timeline
{% endblock %}
{% block page_scripts %}

View File

@ -4,7 +4,7 @@
{% load taglinks %}
{% block title %}
Brutaldon ({{ own_acct.username }}) - {{ user.acct }} timelime
Brutaldon ({{ own_acct.username }}) - {{ user.acct }} timeline
{% endblock %}
{% block content %}

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: