Skip to content
Snippets Groups Projects
Verified Commit 54df673c authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Reduce size of diff

parent e2848cb8
No related branches found
No related tags found
1 merge request!491Resolve "Make Celery non-optional"
Pipeline #5915 passed
......@@ -494,7 +494,9 @@ CELERY_BROKER_URL = _settings.get("celery.broker", "redis://localhost")
CELERY_RESULT_BACKEND = "django-db"
CELERY_CACHE_BACKEND = "django-cache"
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
EMAIL_BACKEND = "djcelery_email.backends.CeleryEmailBackend"
if _settings.get("celery.email", False):
EMAIL_BACKEND = "djcelery_email.backends.CeleryEmailBackend"
PWA_APP_NAME = lazy_preference("general", "title")
PWA_APP_DESCRIPTION = lazy_preference("general", "description")
......
......@@ -2,12 +2,11 @@ from django.conf import settings
from django.core import management
from .celery import app
from .util.celery_progress import ProgressRecorder
from .util.notifications import send_notification as _send_notification
@app.task
def send_notification(notification: int, resend: bool = False, recorder=ProgressRecorder) -> None:
def send_notification(notification: int, resend: bool = False) -> None:
"""Send a notification object to its recipient.
:param notification: primary key of the notification object to send
......@@ -17,7 +16,7 @@ def send_notification(notification: int, resend: bool = False, recorder=Progress
@app.task
def backup_data(recorder=ProgressRecorder) -> None:
def backup_data() -> None:
"""Backup database and media using django-dbbackup."""
# Assemble command-line options for dbbackup management command
db_options = []
......
......@@ -17,6 +17,7 @@ from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
import reversion
from django_celery_results.models import TaskResult
from django_tables2 import RequestConfig, SingleTableView
from dynamic_preferences.forms import preference_form_builder
from guardian.shortcuts import get_objects_for_user
......@@ -30,6 +31,7 @@ from rules.contrib.views import PermissionRequiredMixin, permission_required
from aleksis.core.data_checks import DataCheckRegistry, check_data
from .celery import app
from .filters import GroupFilter, PersonFilter
from .forms import (
AnnouncementForm,
......@@ -410,10 +412,6 @@ class SystemStatus(PermissionRequiredMixin, MainView):
status_code = 500 if self.errors else 200
task_results = []
from django_celery_results.models import TaskResult # noqa
from .celery import app # noqa
if app.control.inspect().registered_tasks():
job_list = list(app.control.inspect().registered_tasks().values())[0]
for job in job_list:
......
......@@ -69,6 +69,9 @@ django-ckeditor = "^6.0.0"
django-js-reverse = "^0.9.1"
calendarweek = "^0.4.3"
Celery = {version="^5.0.0", extras=["django", "redis"]}
django-celery-results = "^2.0.1"
django-celery-beat = "^2.2.0"
django-celery-email = "^3.0.0"
django-jsonstore = "^0.5.0"
django-polymorphic = "^3.0.0"
django-colorfield = "^0.3.0"
......@@ -93,9 +96,6 @@ django-model-utils = "^4.0.0"
bs4 = "^0.0.1"
django-extensions = "^3.1.1"
ipython = "^7.20.0"
django-celery-results = "^2.0.1"
django-celery-beat = "^2.2.0"
django-celery-email = "^3.0.0"
[tool.poetry.extras]
ldap = ["django-auth-ldap"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment