mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-06-12 01:14:30 +02:00
build: replace celery with procrastinate
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
from .celery import app as celery_app
|
||||
|
||||
__all__ = ("celery_app",)
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import os
|
||||
from celery import Celery
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WYGIWYH.settings")
|
||||
app = Celery("WYGIWYH")
|
||||
app.config_from_object("django.conf:settings", namespace="CELERY")
|
||||
app.autodiscover_tasks()
|
||||
@@ -56,7 +56,7 @@ INSTALLED_APPS = [
|
||||
"django_tables2",
|
||||
"django_filters",
|
||||
"apps.users.apps.UsersConfig",
|
||||
"django_celery_beat",
|
||||
"procrastinate.contrib.django",
|
||||
"apps.transactions.apps.TransactionsConfig",
|
||||
"apps.currencies.apps.CurrenciesConfig",
|
||||
"apps.accounts.apps.AccountsConfig",
|
||||
@@ -199,13 +199,6 @@ LOGIN_URL = "/login/"
|
||||
CRISPY_ALLOWED_TEMPLATE_PACKS = ["bootstrap5", "crispy_forms/pure_text"]
|
||||
CRISPY_TEMPLATE_PACK = "bootstrap5"
|
||||
|
||||
# Celery settings
|
||||
CELERY_BROKER_URL = os.getenv("CELERY_BROKER_URL", "redis://redis")
|
||||
CELERY_RESULT_BACKEND = os.getenv("CELERY_BROKER_URL", "redis://redis")
|
||||
REDIS_URL = os.getenv("CELERY_BROKER_URL", "redis://redis")
|
||||
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
|
||||
|
||||
|
||||
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
|
||||
SESSION_COOKIE_AGE = int(os.getenv("SESSION_EXPIRY_TIME", 2678400)) # 31 days
|
||||
SESSION_COOKIE_SECURE = os.getenv("HTTPS_ENABLED", "false").lower() == "true"
|
||||
|
||||
@@ -18,7 +18,7 @@ from apps.transactions.models import Transaction
|
||||
@only_htmx
|
||||
@login_required
|
||||
@require_http_methods(["GET", "POST"])
|
||||
def transaction_add(request, **kwargs):
|
||||
def transaction_add(request):
|
||||
month = int(request.GET.get("month", timezone.localdate(timezone.now()).month))
|
||||
year = int(request.GET.get("year", timezone.localdate(timezone.now()).year))
|
||||
transaction_type = Transaction.Type(request.GET.get("type", "IN"))
|
||||
|
||||
Reference in New Issue
Block a user