bug fix
This commit is contained in:
parent
3ed68732f3
commit
2b3dc53d96
3 changed files with 5 additions and 4 deletions
|
@ -91,7 +91,7 @@ class OAuth2Backend(ModelBackend):
|
|||
|
||||
# when username is provided, assume that token is newly obtained and valid
|
||||
try:
|
||||
user = UserModel._default_manager.filter(username=username, mastodon_site=site)
|
||||
user = UserModel._default_manager.get(username=username, mastodon_site=site)
|
||||
except UserModel.DoesNotExist:
|
||||
return None
|
||||
else:
|
||||
|
|
|
@ -7,5 +7,4 @@ class SyncConfig(AppConfig):
|
|||
|
||||
def ready(self):
|
||||
from sync.jobs import sync_task_manager
|
||||
if settings.START_SYNC:
|
||||
sync_task_manager.start()
|
||||
sync_task_manager.start()
|
|
@ -7,6 +7,7 @@ import threading
|
|||
import time
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from django.conf import settings
|
||||
from django.utils import timezone
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from openpyxl import load_workbook
|
||||
|
@ -73,7 +74,8 @@ class SyncTaskManger:
|
|||
return self.__stop_event.is_set()
|
||||
|
||||
def start(self):
|
||||
self.__enqueue_existing_tasks() # enqueue
|
||||
if settings.START_SYNC:
|
||||
self.__enqueue_existing_tasks() # enqueue
|
||||
|
||||
listen_new_task_thread = threading.Thread(
|
||||
target=self.__listen_for_new_task, daemon=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue