# django
Django==2.2.28
-fnpdjango==0.4.5
+fnpdjango==0.6
docutils==0.16
-django-pipeline==2.0.5
-libsasscompiler==0.1.8
-jsmin==2.2.2
+django-pipeline==2.0.8
+libsasscompiler==0.1.9
+jsmin==3.0.1
-fnp-django-pagination==2.2.3
-django-modeltranslation==0.16.2
-django-allauth==0.44
+fnp-django-pagination==2.2.5
+django-modeltranslation==0.18.2
+django-allauth==0.51
django-extensions==3.1.1
-djangorestframework==3.12.4
-djangorestframework-xml
-django-admin-ordering==0.10.0
-django-machina==1.0.2
-django-countries==7.2.1
+djangorestframework==3.13.1
+djangorestframework-xml==2.0.0
+django-admin-ordering==0.14.0
+django-machina==1.1.6
+django-countries==7.3.2
# A version compatible with Django 2.2, with long help text and editable max_length.
-e git+https://github.com/rczajka/django-forms-builder@8ec4022f2a185658b4b23c3d020e0d5c3cb88774#egg=django-forms-builder
polib==1.1.1
-pytz==2021.1
+pytz==2022.2.1
-django-honeypot==0.9.0
+django-honeypot==1.0.2
python-memcached==1.59
python-fb==0.2
-Feedparser==6.0.2
+Feedparser==6.0.10
-Pillow==8.4.0
+Pillow==9.2.0
mutagen==1.45.1
sorl-thumbnail==12.7.0
# OAI-PMH
pyoai==2.5.0
-scorched==0.12
+scorched==0.13
django-getpaid==1.8.0
deprecated
from catalogue import app_settings
from catalogue.constants import LANGUAGES_3TO2, EBOOK_FORMATS_WITH_CHILDREN, EBOOK_FORMATS_WITHOUT_CHILDREN
from catalogue.utils import absolute_url, remove_zip, truncate_html_words, gallery_path, gallery_url
-from celery.task import Task, task
+from celery import Task, shared_task
from celery.utils.log import get_task_logger
from waiter.utils import clear_cache
if fieldfile.field.format_name in app_settings.FORMAT_ZIPS:
remove_zip(app_settings.FORMAT_ZIPS[fieldfile.field.format_name])
# Don't decorate BuildEbook, because we want to subclass it.
-BuildEbookTask = task(BuildEbook, ignore_result=True)
+BuildEbookTask = shared_task(BuildEbook, ignore_result=True)
@BuildEbook.register('txt')
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
class BuildTxt(BuildEbook):
@staticmethod
def transform(wldoc, fieldfile):
@BuildEbook.register('pdf')
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
class BuildPdf(BuildEbook):
@staticmethod
def transform(wldoc, fieldfile):
@BuildEbook.register('epub')
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
class BuildEpub(BuildEbook):
librarian2_api = True
@BuildEbook.register('mobi')
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
class BuildMobi(BuildEbook):
librarian2_api = True
@BuildEbook.register('html')
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
class BuildHtml(BuildEbook):
def build(self, fieldfile):
from django.core.files.base import ContentFile
@BuildEbook.register('cover_clean')
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
class BuildCoverClean(BuildCover):
@classmethod
def transform(cls, wldoc, fieldfile):
@BuildEbook.register('cover_thumb')
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
class BuildCoverThumb(BuildCover):
@classmethod
def transform(cls, wldoc, fieldfile):
@BuildEbook.register('cover_api_thumb')
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
class BuildCoverApiThumb(BuildCover):
@classmethod
def transform(cls, wldoc, fieldfile):
@BuildEbook.register('simple_cover')
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
class BuildSimpleCover(BuildCover):
@classmethod
def transform(cls, wldoc, fieldfile):
@BuildEbook.register('cover_ebookpoint')
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
class BuildCoverEbookpoint(BuildCover):
@classmethod
def transform(cls, wldoc, fieldfile):
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from traceback import print_exc
-from celery.task import task
+from celery import shared_task
from celery.utils.log import get_task_logger
from django.conf import settings
from django.utils import timezone
type(tag).objects.filter(pk=tag.pk).update(**update_dict)
-@task
+@shared_task
def index_book(book_id, book_info=None, **kwargs):
from catalogue.models import Book
try:
raise e
-@task(ignore_result=True, rate_limit=settings.CATALOGUE_CUSTOMPDF_RATE_LIMIT)
+@shared_task(ignore_result=True, rate_limit=settings.CATALOGUE_CUSTOMPDF_RATE_LIMIT)
def build_custom_pdf(book_id, customizations, file_name, waiter_id=None):
"""Builds a custom PDF file."""
try:
WaitedFile.objects.filter(pk=waiter_id).delete()
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
def update_counters():
from .helpers import update_counters
update_counters()
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
def update_references(book_id):
from catalogue.models import Book
Book.objects.get(id=book_id).update_references()
from datetime import datetime
import json
-from celery.task import task
+from celery import shared_task
from django.conf import settings
import requests
import yaml
settings.CIVICRM_KEY,
)
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
def report_activity(*args, **kwargs):
civicrm.report_activity(*args, **kwargs)
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.db import models, transaction
-from celery.task import task
+from celery import shared_task
from sortify import sortify
from celery.utils.log import get_task_logger
ordering = ['book']
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
def build_notes(book):
if not book.findable:
return
import json
from traceback import print_exc
-from celery.task import task
+from celery import shared_task
from django.core.files.base import ContentFile
from django.template.loader import render_to_string
-@task
+@shared_task
def generate_picture_html(picture_id):
import picture.models
pic = picture.models.Picture.objects.get(pk=picture_id)
pic.html_file.save("%s.html" % pic.slug, ContentFile(html_text))
-@task
+@shared_task
def index_picture(picture_id, picture_info=None, **kwargs):
from picture.models import Picture
try:
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from celery.task import task
+from celery import shared_task
from django.conf import settings
import logging
from urllib.parse import urlsplit
_host = None
-@task(ignore_result=True)
+@shared_task(ignore_result=True)
def track_request(piwik_args):
urlopen("%s%s%s" % (settings.PIWIK_URL, "piwik.php?", piwik_args))
)
}
-STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineCachedStorage'
-#STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
+STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineManifestStorage'
# PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss'
# PIPELINE_PYSCSS_ARGUMENTS = ''