comparison sat/plugins/plugin_misc_lists.py @ 3471:d897597cfa94

plugin list: set `overwrite_policy` to `any_publisher` for `grocery` list
author Goffi <goffi@goffi.org>
date Sat, 27 Feb 2021 18:33:53 +0100
parents ca76767185e3
children e12e9e1535d3
comparison
equal deleted inserted replaced
3470:ca76767185e3 3471:d897597cfa94
490 ).toElement() 490 ).toElement()
491 491
492 service = client.jid.userhostJID() 492 service = client.jid.userhostJID()
493 node = self._s.getSubmittedNS(f"{APP_NS_TICKETS}_{name}") 493 node = self._s.getSubmittedNS(f"{APP_NS_TICKETS}_{name}")
494 options = { 494 options = {
495 self._p.OPT_ACCESS_MODEL: access_model 495 self._p.OPT_ACCESS_MODEL: access_model,
496 } 496 }
497 if template_id == "grocery":
498 # for grocery list, we want all publishers to be able to set all items
499 # XXX: should node options be in TEMPLATE?
500 options[self._p.OPT_OVERWRITE_POLICY] = self._p.OWPOL_ANY_PUB
497 await self._p.createNode(client, service, node, options) 501 await self._p.createNode(client, service, node, options)
498 await self._s.setSchema(client, service, node, schema) 502 await self._s.setSchema(client, service, node, schema)
499 list_elt = domish.Element((APP_NS_TICKETS, "list")) 503 list_elt = domish.Element((APP_NS_TICKETS, "list"))
500 list_elt["type"] = template_id 504 list_elt["type"] = template_id
501 try: 505 try: