[PATCH] [views/uicfg] obvious bug detected by sonar

Denis Laxalde denis.laxalde at logilab.fr
Mon Jun 11 16:54:14 CEST 2018


Nicolas Chauvat a écrit :
> # HG changeset patch
> # User Nicolas Chauvat <nicolas.chauvat at logilab.fr>
> # Date 1528303036 -7200
> #      Wed Jun 06 18:37:16 2018 +0200
> # Node ID aa15dd521d04cf682ef44b866ea26bfea8f939ce
> # Parent  a7c4b13a2d60720c087905cdac5f93d36d578c04
> [views/uicfg] obvious bug detected by sonar

Applied, thanks.

> 
> diff --git a/cubicweb/web/views/uicfg.py b/cubicweb/web/views/uicfg.py
> --- a/cubicweb/web/views/uicfg.py
> +++ b/cubicweb/web/views/uicfg.py
> @@ -231,11 +231,11 @@ class AutoformSectionRelationTags(Relati
>          else:
>              # we still need to expand wildcard in defined keys
>              for key in list(self._tagdefs):
>                  stype, rtype, otype, role = key
>                  rschema = schema.rschema(rtype)
> -                if stype == '*' and stype == '*':
> +                if stype == '*' and otype == '*':
>                      concrete_rdefs = rschema.rdefs.keys()
>                  elif stype == '*':
>                      concrete_rdefs = zip(rschema.subjects(otype), repeat(otype))
>                  elif otype == '*':
>                      concrete_rdefs = zip(repeat(stype), rschema.objects(stype))
> 


More information about the cubicweb-devel mailing list