[PATCH 3 of 3 3.26] Flake8 cubicweb/web/views/autoform.py

Denis Laxalde denis.laxalde at logilab.fr
Thu Jun 27 12:53:57 CEST 2019


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1561631257 -7200
#      jeu. juin 27 12:27:37 2019 +0200
# Branch 3.26
# Node ID 51a2cfb7e926198e34ce9da7faccbd345ea53fab
# Parent  fff386470c834a630e2e7428834ae58815e88545
# Available At https://hg.logilab.org/review/cubicweb
#              hg pull https://hg.logilab.org/review/cubicweb -r 51a2cfb7e926
Flake8 cubicweb/web/views/autoform.py

Fixes:

  cubicweb/web/views/autoform.py:703: [E122] continuation line missing indentation or outdented
  cubicweb/web/views/autoform.py:704: [E122] continuation line missing indentation or outdented
  cubicweb/web/views/autoform.py:819: [W504] line break after binary operator
  cubicweb/web/views/autoform.py:820: [E125] continuation line with same indent as next logical line
  cubicweb/web/views/autoform.py:961: [W504] line break after binary operator
  cubicweb/web/views/autoform.py:962: [E126] continuation line over-indented for hanging indent

diff --git a/cubicweb/web/views/autoform.py b/cubicweb/web/views/autoform.py
--- a/cubicweb/web/views/autoform.py
+++ b/cubicweb/web/views/autoform.py
@@ -700,8 +700,8 @@ class UnrelatedDivs(EntityView):
   </select>
 </div>
 """ % (hidden and 'hidden' or '', divid, selectid,
-       xml_escape(json_dumps(entity.eid)), is_cell and 'true' or 'null',
-       relname, '\n'.join(options))
+            xml_escape(json_dumps(entity.eid)), is_cell and 'true' or 'null',
+            relname, '\n'.join(options))
 
     def _get_select_options(self, entity, rschema, role):
         """add options to search among all entities of each possible type"""
@@ -816,8 +816,8 @@ class AutomaticEntityForm(forms.EntityFi
         if self.formtype == 'main':
             # add the generic relation field if necessary
             if entity.has_eid() and (
-                self.display_fields is None or
-                '_cw_generic_field' in self.display_fields):
+                    self.display_fields is None
+                    or '_cw_generic_field' in self.display_fields):
                 try:
                     field = self.field_by_name('_cw_generic_field')
                 except f.FieldNotFound:
@@ -958,9 +958,9 @@ class AutomaticEntityForm(forms.EntityFi
         relation.
         """
         return (self.should_display_add_new_relation_link(
-            rschema, existing, card) and
-                self.check_inlined_rdef_permissions(
-                    rschema, role, tschema, ttype))
+            rschema, existing, card)
+            and self.check_inlined_rdef_permissions(
+            rschema, role, tschema, ttype))
 
     def check_inlined_rdef_permissions(self, rschema, role, tschema, ttype):
         """return true if permissions are granted on the inlined object and
diff --git a/flake8-ok-files.txt b/flake8-ok-files.txt
--- a/flake8-ok-files.txt
+++ b/flake8-ok-files.txt
@@ -123,6 +123,7 @@ cubicweb/web/test/unittest_views_basetem
 cubicweb/web/test/unittest_views_cwsources.py
 cubicweb/web/test/unittest_views_json.py
 cubicweb/web/views/authentication.py
+cubicweb/web/views/autoform.py
 cubicweb/web/views/cwuser.py
 cubicweb/web/views/editcontroller.py
 cubicweb/web/views/json.py



More information about the cubicweb-devel mailing list