comparison src/pages/tickets/new/page_meta.py @ 977:d0de2a98e852

pages (tickets/new): refuse data if body is not set
author Goffi <goffi@goffi.org>
date Sat, 11 Nov 2017 19:02:27 +0100
parents 0f676f09404b
children a78169c1bf77
comparison
equal deleted inserted replaced
976:0f676f09404b 977:d0de2a98e852
35 def on_data_post(self, request): 35 def on_data_post(self, request):
36 data = self.getRData(request) 36 data = self.getRData(request)
37 service = data['service'] 37 service = data['service']
38 node = data['node'] 38 node = data['node']
39 posted_data = self.getAllPostedData(request) 39 posted_data = self.getAllPostedData(request)
40 if not posted_data['title']: 40 if not posted_data['title'] or not posted_data['body']:
41 self.pageError(request, C.HTTP_BAD_REQUEST) 41 self.pageError(request, C.HTTP_BAD_REQUEST)
42 try: 42 try:
43 posted_data['labels'] = [l.strip() for l in posted_data['labels'][0].split(',')] 43 posted_data['labels'] = [l.strip() for l in posted_data['labels'][0].split(',')]
44 except (KeyError, IndexError): 44 except (KeyError, IndexError):
45 pass 45 pass