Automatically set event to booked when the client authorises it (#332)

* Automatically set rig to booked when event is authorised
Will close #320
This commit is contained in:
Johnathan Graydon
2018-03-26 14:51:42 +01:00
committed by GitHub
parent c74bc945b6
commit 06daacf611

View File

@@ -2,6 +2,7 @@ import re
import urllib.request
import urllib.error
import urllib.parse
import reversion
from io import BytesIO
from django.db.models.signals import post_save
@@ -91,6 +92,11 @@ def send_eventauthorisation_success_email(instance):
client_email.send(fail_silently=True)
mic_email.send(fail_silently=True)
# Set event to booked now that it's authorised
with reversion.create_revision():
instance.event.status = models.Event.BOOKED
instance.event.save()
def on_revision_commit(sender, instance, created, **kwargs):
if created: