Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • cubicweb cubicweb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 197
    • Issues 197
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cubicweb
  • cubicwebcubicweb
  • Issues
  • #79

Closed
Open
Created Aug 26, 2020 by Carine Dengler@cdenglerMaintainer

subjrels ne sont pas mis à jour suite à make_workflowable

version concernée: 3.28.0

récapitulatif: la fonction make_workflowable ne peut plus être utilisé avec add_workflow dans la version 3.28.0 (bien que dans la version 3.26.0 cela n'a pas posé problème), une erreur est remontée qui me dit qu'il manque les relations nécessaires missing workflow relations, see make_workflowable(EMailMessage)

détails:

>>> from cubicweb_risc.schema import EMailMessage
>>> EMailMessage.__relations__
[<date(Date)>, <subject(String)>, <body(String)>, <body_format(String)>]
>>> from cubicweb.schema import make_workflowable
>>> make_workflowable(EMailMessage)
>>> EMailMessage.__relations__
[<date(Date)>, <subject(String)>, <body(String)>, <body_format(String)>, <RelationDefinition 'custom_workflow' @7f05bba0a5f8>, <RelationDefinition 'in_state' @7f05bba0a2e8>, <RelationDefinition 'wf_info_for' @7f05bba0a940>]
>>> eschema = cnx.repo.schema["EMailMessage"]
>>> [r.type for r in eschema.subjrels]
['eid', 'identity', 'cwuri', 'body', 'body_format', 'creation_date', 'subject', 'date', 'modification_date', 'owned_by', 'created_by', 'is', 'cw_source', 'is_instance_of', 'sender', 'keyword']

côté cubicweb, si on appelle add_workflow, cela regarde dans subjrels pour vérifier si l'entité est workflowable

if ensure_workflowable:
    assert 'in_state' in eschema.subjrels, _missing_wf_rel(etype)
    assert 'custom_workflow' in eschema.subjrels, _missing_wf_rel(etype)
    assert 'wf_info_for' in eschema.objrels, _missing_wf_rel(etype)

dans cubicweb/server/migractions.py, donc il semble que eschema.subjrels n'est pas mis à jour correctement

Edited Aug 26, 2020 by Laurent Peuch
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking