Mercurial > libervia-web
comparison src/pages/merge-requests/view/page_meta.py @ 1097:f134c0ecb1d5
pages (merge-requests/view): fixed default node when checking affiliations
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 01 Jun 2018 15:07:06 +0200 |
parents | 7d5633ccbaf2 |
children | 01e95ec9df9e |
comparison
equal
deleted
inserted
replaced
1096:01538d8a77be | 1097:f134c0ecb1d5 |
---|---|
69 # we set edition URL only if user is the publisher or the node owner | 69 # we set edition URL only if user is the publisher or the node owner |
70 publisher = jid.JID(ticket.widgets['publisher'].value) | 70 publisher = jid.JID(ticket.widgets['publisher'].value) |
71 is_publisher = publisher.userhostJID() == session.jid.userhostJID() | 71 is_publisher = publisher.userhostJID() == session.jid.userhostJID() |
72 affiliation = None | 72 affiliation = None |
73 if not is_publisher: | 73 if not is_publisher: |
74 node = node or self.host.ns_map['tickets'] | 74 node = node or self.host.ns_map['merge_requests'] |
75 affiliation = yield self.host.getAffiliation(request, service, node) | 75 affiliation = yield self.host.getAffiliation(request, service, node) |
76 if is_publisher or affiliation == 'owner': | 76 if is_publisher or affiliation == 'owner': |
77 template_data[u'url_ticket_edit'] = self.getURLByPath(SubPage('merge-requests'), service.full(), node or u'@', SubPage('merge-requests_edit'), ticket_id) | 77 template_data[u'url_ticket_edit'] = self.getURLByPath(SubPage('merge-requests'), service.full(), node or u'@', SubPage('merge-requests_edit'), ticket_id) |
78 | 78 |
79 @defer.inlineCallbacks | 79 @defer.inlineCallbacks |