cubicweb/web/views/workflow.py
changeset 12251 fd7086b701de
parent 12210 3fa6c9ef2f51
child 12355 c703dc95c82e
equal deleted inserted replaced
12250:afc678253bc2 12251:fd7086b701de
    24 
    24 
    25 from cubicweb import _
    25 from cubicweb import _
    26 
    26 
    27 import os
    27 import os
    28 
    28 
    29 from six import add_metaclass
    29 from six import add_metaclass, text_type
    30 
    30 
    31 from logilab.mtconverter import xml_escape
    31 from logilab.mtconverter import xml_escape
    32 from logilab.common.deprecation import class_deprecated
    32 from logilab.common.deprecation import class_deprecated
    33 
    33 
    34 from cubicweb import Unauthorized
    34 from cubicweb import Unauthorized
   311 
   311 
   312 def _wf_items_for_relation(req, wfeid, wfrelation, field):
   312 def _wf_items_for_relation(req, wfeid, wfrelation, field):
   313     wf = req.entity_from_eid(wfeid)
   313     wf = req.entity_from_eid(wfeid)
   314     rschema = req.vreg.schema[field.name]
   314     rschema = req.vreg.schema[field.name]
   315     param = 'toeid' if field.role == 'subject' else 'fromeid'
   315     param = 'toeid' if field.role == 'subject' else 'fromeid'
   316     return sorted((e.view('combobox'), unicode(e.eid))
   316     return sorted((e.view('combobox'), text_type(e.eid))
   317                   for e in getattr(wf, 'reverse_%s' % wfrelation)
   317                   for e in getattr(wf, 'reverse_%s' % wfrelation)
   318                   if rschema.has_perm(req, 'add', **{param: e.eid}))
   318                   if rschema.has_perm(req, 'add', **{param: e.eid}))
   319 
   319 
   320 
   320 
   321 # TrInfo
   321 # TrInfo