Commit 0f1d467e authored by Robert's avatar Robert

Add huey

parent 085ec42b
......@@ -13,7 +13,7 @@ Architecture: all
Depends: python3-html2text, python3-pil, python3-requests, python3-six,
python3-xapian ${misc:Depends}, ${python3:Depends}, moreutils
Recommends: ghostscript, python3-psycopg2, uwsgi, uwsgi-plugin-python3,
uwsgi-plugin-router-access, ${misc:Recommends}
uwsgi-plugin-router-access, redis-server, ${misc:Recommends}
Suggests: sqlite3, postgresql-client-common
Description: Web platform that enables social action and solidarity
Stadtgestalten is a web-based platform providing tools for groups and
......
......@@ -3,7 +3,7 @@ from datetime import timedelta
from django.dispatch import receiver, Signal
from django.utils.timezone import now
from . import notifications
from features.content.tasks import send_content_notifications
post_create = Signal(providing_args=['instance'])
......@@ -11,4 +11,4 @@ post_create = Signal(providing_args=['instance'])
@receiver(post_create)
def content_created(sender, instance, **kwargs):
if now() - instance.versions.last().time_created < timedelta(weeks=1):
notifications.ContentCreated.send_all(instance)
send_content_notifications(instance)
from huey.contrib.djhuey import task
from features.content.notifications import ContentCreated
@task()
def send_content_notifications(instance):
ContentCreated.send_all(instance)
import django.db.models.signals
from django.dispatch import receiver
from . import notifications
from features.contributions.tasks import send_contribution_notifications
post_create = django.dispatch.Signal(providing_args=['instance'])
......@@ -9,4 +9,4 @@ post_create = django.dispatch.Signal(providing_args=['instance'])
@receiver(post_create)
def contribution_created(sender, instance, **kwargs):
notifications.ContributionCreated.send_all(instance)
send_contribution_notifications(instance)
from huey.contrib.djhuey import task
from features.contributions.notifications import ContributionCreated
@task()
def send_contribution_notifications(instance):
ContributionCreated.send_all(instance)
......@@ -13,6 +13,7 @@ djangorestframework # debian: python-djangorestframework
feedparser # debian: python3-feedparser
flake8 # debian: flake8
html2text # debian: python3-html2text
huey
markdown<3 # debian: python3-markdown
mdx_unimoji # NOT IN DEBIAN
pillow # debian: python-pil
......@@ -21,8 +22,9 @@ aiosmtplib # NOT IN DEBIAN
schulze # NOT IN DEBIAN
randomcolor # NOT IN DEBIAN
raven # debian (buster): python3-raven
redis
requests # debian: python3-requests
rules # debian (buster): python3-django-rules
rules<2.0.1 # debian (buster): python3-django-rules
translitcodec # NOT IN DEBIAN
xapian-haystack # debian (buster): python3-xapian-haystack
# xapian-haystack also requires the xapian python bindings that you'll find
......
......@@ -23,6 +23,7 @@ INSTALLED_APPS = [
'django.forms',
'django_filters',
'django_mailbox',
'huey.contrib.djhuey',
'features.articles',
'features.associations',
'features.contributions',
......
......@@ -6,3 +6,6 @@ DATABASES = {
}
}
GROUPRISE_UNKNOWN_GESTALT_ID = 1
HUEY = {
'always_eager': True,
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment