Mercurial > libervia-web
comparison src/pages/merge-requests/edit/page_meta.py @ 1098:01e95ec9df9e
server, pages: fixed blocking calls to bridge by using bridgeCall instead
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 01 Jun 2018 15:09:19 +0200 |
parents | 01538d8a77be |
children | cdd389ef97bc |
comparison
equal
deleted
inserted
replaced
1097:f134c0ecb1d5 | 1098:01e95ec9df9e |
---|---|
31 service, node, ticket_id = data.get(u'service', u''), data.get(u'node', u''), data[u'ticket_id'] | 31 service, node, ticket_id = data.get(u'service', u''), data.get(u'node', u''), data[u'ticket_id'] |
32 profile = self.getProfile(request) | 32 profile = self.getProfile(request) |
33 | 33 |
34 | 34 |
35 ignore = ('publisher', 'author', 'author_jid', 'author_email', 'created', 'updated', 'comments_uri', 'request_data', 'type') | 35 ignore = ('publisher', 'author', 'author_jid', 'author_email', 'created', 'updated', 'comments_uri', 'request_data', 'type') |
36 tickets = yield self.host.bridge.mergeRequestsGet(service.full() if service else u'', node, C.NO_LIMIT, [ticket_id], '', {}, profile) | 36 tickets = yield self.host.bridgeCall("mergeRequestsGet", service.full() if service else u'', node, C.NO_LIMIT, [ticket_id], '', {}, profile) |
37 ticket = [template_xmlui.create(self.host, x, ignore=ignore) for x in tickets[0]][0] | 37 ticket = [template_xmlui.create(self.host, x, ignore=ignore) for x in tickets[0]][0] |
38 | 38 |
39 try: | 39 try: |
40 # small trick to get a one line text input instead of the big textarea | 40 # small trick to get a one line text input instead of the big textarea |
41 ticket.widgets[u'labels'].type = u'string' | 41 ticket.widgets[u'labels'].type = u'string' |
56 try: | 56 try: |
57 posted_data['labels'] = [l.strip() for l in posted_data['labels'][0].split(',')] | 57 posted_data['labels'] = [l.strip() for l in posted_data['labels'][0].split(',')] |
58 except (KeyError, IndexError): | 58 except (KeyError, IndexError): |
59 pass | 59 pass |
60 profile = self.getProfile(request) | 60 profile = self.getProfile(request) |
61 yield self.host.bridge.mergeRequestSet(service.full(), | 61 yield self.host.bridgeCall("mergeRequestSet", service.full(), |
62 node, | 62 node, |
63 u'', | 63 u'', |
64 u'auto', | 64 u'auto', |
65 posted_data, | 65 posted_data, |
66 u'', | 66 u'', |
67 ticket_id, | 67 ticket_id, |
68 {'update': C.BOOL_TRUE}, | 68 {'update': C.BOOL_TRUE}, |
69 profile) | 69 profile) |
70 # we don't want to redirect to edit page on success, but to tickets list | 70 # we don't want to redirect to edit page on success, but to tickets list |
71 data['post_redirect_page'] = (self.getPageByName(u'merge-requests'), | 71 data['post_redirect_page'] = (self.getPageByName(u'merge-requests'), |
72 service.full(), | 72 service.full(), |
73 node or u'@') | 73 node or u'@') |