Python Format/import opt

This commit is contained in:
2020-04-12 19:28:17 +01:00
parent f308a095f3
commit 5e60675115
22 changed files with 257 additions and 111 deletions

View File

@@ -95,7 +95,8 @@ class EventRA(generic.base.RedirectView):
'entry.708610078': f'N{event.pk:05}',
'entry.905899507': event.name,
'entry.139491562': event.venue.name if event.venue else '',
'entry.1689826056': event.start_date.strftime('%Y-%m-%d') + ((' - ' + event.end_date.strftime('%Y-%m-%d')) if event.end_date else ''),
'entry.1689826056': event.start_date.strftime('%Y-%m-%d') + (
(' - ' + event.end_date.strftime('%Y-%m-%d')) if event.end_date else ''),
'entry.902421165': event.mic.name if event.mic else ''
}
return settings.RISK_ASSESSMENT_URL + "?" + urllib.parse.urlencode(params)
@@ -149,10 +150,12 @@ class EventUpdate(generic.UpdateView):
if not hasattr(context, 'duplicate'):
# 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.')
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.')
messages.warning(self.request,
'This event has already been authorised by client, any changes to price will require reauthorisation.')
return super(EventUpdate, self).render_to_response(context, **response_kwargs)
def get_success_url(self):