From 0a45b047a29d709d7f42f2f81d8b35aaf685cffe Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 18 May 2017 17:34:49 +0100 Subject: [PATCH] Add warnings when editing an event that has already been sent to a client --- RIGS/rigboard.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RIGS/rigboard.py b/RIGS/rigboard.py index dbe7e6c7..e9597ab5 100644 --- a/RIGS/rigboard.py +++ b/RIGS/rigboard.py @@ -118,6 +118,14 @@ class EventUpdate(generic.UpdateView): value = form[field].value() if value is not None and value != '': context[field] = model.objects.get(pk=value) + + # If this event has already been emailed to a client, show a warning + if self.object.auth_request_at is not None: + messages.info(self.request, 'This event has already been sent to the client for authorisation, any changes you make will be visible to them immediately.') + + if hasattr(self.object, 'authorised'): + messages.warning(self.request, 'This event has already been authorised by client, any changes to price will require reauthorisation.') + return context def get_success_url(self):