mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
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:
committed by
GitHub
parent
c74bc945b6
commit
06daacf611
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user