Fix #65 :
All checks were successful
Run tests / Execute tox to run the test suite (push) Successful in 3m29s
All checks were successful
Run tests / Execute tox to run the test suite (push) Successful in 3m29s
dav_events.views.events.EventRegistrationsView._close_registration() sends a signal now.
This commit is contained in:
@@ -21,6 +21,7 @@ from .. import choices
|
||||
from .. import emails
|
||||
from .. import forms
|
||||
from .. import models
|
||||
from .. import signals
|
||||
from ..roles import get_users_by_role, has_role
|
||||
from ..workflow import DefaultWorkflow
|
||||
|
||||
@@ -261,19 +262,11 @@ class EventRegistrationsView(EventPermissionMixin, generic.DetailView):
|
||||
|
||||
return context
|
||||
|
||||
def _notify_publisher(self, event, editor):
|
||||
recipients = get_users_by_role('publisher_web')
|
||||
recipients += get_users_by_role('publisher_facebook')
|
||||
for recipient in recipients:
|
||||
if recipient.email:
|
||||
email = emails.EventRegistrationClosedMail(recipient=recipient, event=event, editor=editor)
|
||||
email.send()
|
||||
|
||||
def _close_registration(self, request, event):
|
||||
logger.info('Close registration: %s', event)
|
||||
event.registration_closed = True
|
||||
event.save(implicit_update=True)
|
||||
self._notify_publisher(event, request.user)
|
||||
signals.event_registration_closed.send(sender=self.__class__, event=event, user=request.user)
|
||||
messages.success(request, _(u'Die Anmeldung wurde geschlossen'))
|
||||
|
||||
def _reopen_registration(self, request, event):
|
||||
|
||||
Reference in New Issue
Block a user