comparison libervia/pages/merge-requests/edit/page_meta.py @ 1194:bed008b65d7c

pages (merge-requests/edit, tickets/edit, tickets/new): use serialised extra following backend change + fixed use of "update" when editing ticket: "update" was not set in extra, as a result some metadata could be lost on update (author, comments_uri). fix 301
author Goffi <goffi@goffi.org>
date Fri, 14 Jun 2019 12:50:59 +0200
parents 29eb15062416
children b2d067339de3
comparison
equal deleted inserted replaced
1193:aee3d8fa679f 1194:bed008b65d7c
3 3
4 from libervia.server.constants import Const as C 4 from libervia.server.constants import Const as C
5 from sat.core.i18n import _ 5 from sat.core.i18n import _
6 from twisted.internet import defer 6 from twisted.internet import defer
7 from sat.tools.common import template_xmlui 7 from sat.tools.common import template_xmlui
8 from sat.tools.common import data_format
8 from sat.core.log import getLogger 9 from sat.core.log import getLogger
9 10
10 """merge-requests edition""" 11 """merge-requests edition"""
11 12
12 name = u"merge-requests_edit" 13 name = u"merge-requests_edit"
100 u"syntaxConvert", posted_data[u'body'][0], u"markdown", C.SYNTAX_XHTML, 101 u"syntaxConvert", posted_data[u'body'][0], u"markdown", C.SYNTAX_XHTML,
101 False, profile) 102 False, profile)
102 posted_data[u'body'] = [u'<div xmlns="{ns}">{body}</div>'.format(ns=C.NS_XHTML, 103 posted_data[u'body'] = [u'<div xmlns="{ns}">{body}</div>'.format(ns=C.NS_XHTML,
103 body=body)] 104 body=body)]
104 105
106 extra = {u'update': True}
105 yield self.host.bridgeCall( 107 yield self.host.bridgeCall(
106 "mergeRequestSet", 108 "mergeRequestSet",
107 service.full(), 109 service.full(),
108 node, 110 node,
109 u"", 111 u"",
110 u"auto", 112 u"auto",
111 posted_data, 113 posted_data,
112 u"", 114 u"",
113 ticket_id, 115 ticket_id,
114 {"update": C.BOOL_TRUE}, 116 data_format.serialise(extra),
115 profile, 117 profile,
116 ) 118 )
117 # we don't want to redirect to edit page on success, but to tickets list 119 # we don't want to redirect to edit page on success, but to tickets list
118 data["post_redirect_page"] = ( 120 data["post_redirect_page"] = (
119 self.getPageByName(u"merge-requests"), 121 self.getPageByName(u"merge-requests"),