waiting list: add waiting status confirmation mechanism and automation with celery beat
parent
a362f963b4
commit
ed8d8b0434
@ -0,0 +1,3 @@
|
||||
from .celery import app as celery_app
|
||||
|
||||
__all__ = ('celery_app',)
|
||||
@ -0,0 +1,10 @@
|
||||
from celery import shared_task
|
||||
from django.utils import timezone
|
||||
from django.conf import settings
|
||||
from .models import MemberWaitingList
|
||||
|
||||
@shared_task
|
||||
def ask_for_waiting_confirmation():
|
||||
cutoff = timezone.now() - timezone.timedelta(days=settings.WAITING_CONFIRMATION_FREQUENCY)
|
||||
for waiter in MemberWaitingList.objects.filter(last_wait_confirmation__lte=cutoff):
|
||||
waiter.ask_for_wait_confirmation()
|
||||
@ -0,0 +1,21 @@
|
||||
{% extends "members/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}
|
||||
{% trans "Waiting confirmation failed" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>{% trans "Waiting confirmation failed" %}</h1>
|
||||
|
||||
{% if expired %}
|
||||
{% url 'members:register_waiting_list' as reg_wait_link %}
|
||||
<p>{% blocktrans %}Unfortunately, you did not confirm your intention to stay on the waiting list in time. You lost your spot on the list. You can <a href="{{reg_wait_link}}">rejoin the waiting list</a>.{% endblocktrans %}
|
||||
</p>
|
||||
{% else %}
|
||||
<p>{% trans "The supplied link is invalid." %}</p>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
@ -0,0 +1,23 @@
|
||||
{% extends "members/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}
|
||||
{% trans "Waiting confirmed" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>{% trans "Waiting confirmed" %}</h1>
|
||||
|
||||
{% if already_confirmed %}
|
||||
<p>{% blocktrans %}Thank you {{prename}} for your interest in staying on the waiting list.
|
||||
Your spot was already confirmed.{% endblocktrans %}
|
||||
</p>
|
||||
{% else %}
|
||||
<p>{% blocktrans %}Thank you {{prename}} for your interest in staying on the waiting list.
|
||||
Your spot has been confirmed.{% endblocktrans %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
Loading…
Reference in New Issue