From bb6e7dccb6b564621b8ce6e5aae05f0a982d902f Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 3 Jun 2023 19:20:30 -0400 Subject: [PATCH] fix some mastodon 3.x login --- .pre-commit-config.yaml | 2 +- requirements.txt | 2 +- users/account.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61edcd73..40823617 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: language_version: python3.11 repos: - repo: https://github.com/Riverside-Healthcare/djLint - rev: v1.28.0 + rev: v1.30.2 hooks: - id: djlint-reformat-django - id: djlint-django diff --git a/requirements.txt b/requirements.txt index 87bd75ff..003ab990 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ dateparser mistune @ git+https://github.com/alphatownsman/mistune.git@660b1c0100ecdd6cd6aca26a554be2606a67d67b rq>=1.12.0 -django~=3.2.18 +django~=3.2.19 django-auditlog django-markdownx @ git+https://github.com/alphatownsman/django-markdownx.git@e69480c64ad9c5d0499f4a8625da78cf2bb7691b django-jsoneditor @ git+https://github.com/alphatownsman/django-jsoneditor.git@fa2ae41aeeb34447bd8a808a520e843c853fd16e diff --git a/users/account.py b/users/account.py index a82584b3..f2d16004 100644 --- a/users/account.py +++ b/users/account.py @@ -243,7 +243,7 @@ def swap_login(request, token, site, refresh_token): def auth_login(request, user): """Decorates django ``login()``. Attach token to session.""" - auth.login(request, user) + auth.login(request, user, backend="mastodon.auth.OAuth2Backend") if ( user.mastodon_last_refresh < timezone.now() - timedelta(hours=1) or user.mastodon_account == {}